[Greasemonkey] Grab text string in TD

Scott R. Turner srt at aero.org
Fri Apr 22 12:24:11 EDT 2005

On Fri, 22 Apr 2005, Edward Lee wrote:
> Or more like the original code..
> var html = document.documentElement.innerHTML;
> html = html.replace(regexp, replace);
> document.documentElement.innerHTML = html;
> Or if you don't want to modify the head and just the body, use
> document.body.innerHTML instead.

Doesn't seem to work for me.  Here's my script:

// ==UserScript==
// @name          Goggle
// @namespace     none
// @description	  Text replacement
// @include       http://*.google.com/*
// ==/UserScript==

   document.body.innerHTML = document.body.innerHTML.replace(/Google/,/Goggle/);


But instances of "Google" on the page remain "Google".  Do you have
force a reparse of the HTML?

 	-- Scott

More information about the Greasemonkey mailing list