[Greasemonkey] Grab text string in TD

Scott R. Turner srt at aero.org
Fri Apr 22 10:05:40 EDT 2005

On Thu, 21 Apr 2005, Julien Couvreur wrote:
> Looking at a table using the DOM inspector (see Tools menu in
> Firefox), you'll see that the text contained in the TD is actually
> stored in a sub-node of the TD, not in an attribute on the TD node.
> There may be more than one sub-node under that TD, if you don't
> simply put text in your table, but some html formatted text (bold
> text, links,...) in there too.

In my previous work in this sort of user intermediation, my scripts
worked directly on the HTML as text.  That has its plusses and minuses
-- it makes something like the original poster's problem fairly
trivial.  It makes other things hard.

It would be nice if GM provided the tools to work either way.  We had
a little aborted discussion here about getting all the displayed text
on a page, but maybe we could discuss what kinds of tools would be
useful.  Perhaps something like:

     GM_find_and_replace(regexp, replace)

which would search through all the "plain text" on the page doing
replacements.  And a similar function


which would do the same thing operating on the HTML.  Is something
like that possible/desirable?

 	  -- Scott

More information about the Greasemonkey mailing list