Forum Moderators: open
I am working on some JavaScript for Firefox that builds a string to replace the innerHTML of a visited webpage. I have noticed that this seems to disable the search buttons on Google's results page (but not on the Google homepage). Also, pressing enter after typing in a search term has no effect. I have yet to come across another webpage that has the same symptoms.
I even tried just replacing the innerHTML with itself to make sure that I'm not altering anything at all but even this breaks the Google results page. Here is the code I used for this:
var win = document.commandDispatcher.focusedWindow;
var innerHTML = win.document.body.innerHTML;
win.document.body.innerHTML = innerHTML;
The resulting document is identical to the original. The page even looks the same in Firefox. Only the search buttons don't work (and the enter key to submit search terms).
Has anyone else had similar experience? Any ideas on what is causing it? Suggestions on how to work around?
Thanks!