[Greasemonkey] Grab text string in TD

Aaron Boodman zboogs at gmail.com
Fri Apr 22 12:53:01 EDT 2005


The way we inject scripts doesn't seem to interact well with innerHTML.

Sorry, should have advised you to add to the onload handler. A slight
complication which will soon be fixed.

Like so:

window.addEventListener("onload", function() {
  document.body.innerHTML = document.body.innerHTML.replace(/foo/gi, "bar");
}, false);

I think this is an FAQ.

-- 
Aaron

On 4/22/05, Scott R. Turner <srt at aero.org> wrote:
> On Fri, 22 Apr 2005, Edward Lee wrote:
> > Does this not work for you?
> >
> > (function() {
> > with (document.documentElement) {
> > innerHTML = innerHTML.replace(/Google/g, 'Gooooogle!');
> > }
> > }) ();
> 
> It not only doesn't work, it crashes my browser.  I thought maybe it
> was an interaction with other Google scripts, but I turned them off
> and it still crashed the browser.
> 
> Does it work for everyone else?
> 
>         -- Scott
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list