How can I replace a function by javascript?
I want to disable the function function Qa(a){try{var b=(document.forms[0].q||"").value;b&&(a.href=a.href.replace(/([?&])q=[^&]*|$/,function(a,c){return(c||"&")+"q="+encodeURIComponent(b)}))}catch(c){q(c,"sb","pq")}}
in Google Maps. It shows additional page on any external link.
Google Maps generates all the code of the page on the fly. So when the page is loaded it doesn't contain 'Qa' function yet.
The following answer doesn't help: Insert code into the page context using a content script