[Greasemonkey] web page javascript generated html removal

Dano Carroll dano at xernolan.org
Thu Apr 6 09:17:12 EDT 2006


I've been banging my head against a wall (otherwise known as learning)
about how to override a web site's need to load a flash doohickey
every time I go to any web site in a particular domain. Don't answer
yet, read on, this does have to do with greasemonkey. I have been
using privoxy to simply disable flash loading completely and it has
worked up to now. 

Now this web site is checking to see if flash is installed in my
browser and popping up an annoying alert every time it fails to find
it. Fine, I'll just use greasemonkey and override the javascript that
checks for the presense of flash. Nope, greasemonkey gets loaded too
late in the game (for a very good reason, I know) and I can't do the
override thing. Well maybe I can simply remove the html that puts the
flash thing on the screen. I find that the site's javascript is creating
tables to layout this flash thing so I write a greasemonkey script to
remove all tables to see if I'm on the right track. I put in GM_logs
and find that the script seems to be working. However, all the layout
is intact. I go to the DOM browser and see all those tables there that
supposedly had been deleted. Is there anything I need to do to commit
the changes? Is something happening like:

1. load the html, running loaded scripts as they are encountered.
2. greasemonkey script is run, removing the html generated by the
loaded javascript.
3. page is re-loaded due to the change or finally rendered causing the
loaded javascript to be re-run, regenerating the html I had just removed.

Thanks,
Dano

-- 

"I aim to misbehave" - Malcom Reynolds, Captain/Owner of Serenity




More information about the Greasemonkey mailing list