[Greasemonkey] replacing image on a page
Johan Sundström
oyasumi at gmail.com
Sat Jun 17 23:22:48 EDT 2006
> Really? I'm using GM in combination with userContent.css (an extremely
> useful marriage, by the way) for giving style to rfcs in faqs.org. GM adds
> some HTML tags with class information, which are then processed according to
> userContent.css. I don't know whether this means that GM executes before
> the style rules are applied, in which case your suggestion might not work.
While nobody asked for tacky analogies and bad puns, user CSS and user
javascript are a bit like law and order.
CSS (whether prefixed "user" or not) is the law, and it always
applies. Adhering to it is built into the bones of your browser
rendering engine internals, and so those rules are at play from the
first byte of HTML loaded of a page until you've left it behind for
the next.
User javascript (a GM script, in the context of this list; other
browsers have other names for the concept) is more of an order; once
the HTML of a page is loaded, some smart-ass deputy comes around,
ordering around the furniture as he sees fit. It's more of a one-shot
affair, and at least in GM, this copper is a fattening middle-age man
who typically arrives a little late to stop unwieldy HTML from not
going about things his way right away.
If you're really into dictating your own browser law and order, you
get best results doing a little bit of both; law isn't very expressive
and good with details on a case-by-case basis, ordering things around
won't always happen until some initial damage has been done. But
combine the two, and you've got two decent iron fists to rule with,
there.
Happy hacking!
--
/ Johan Sundström, http://ecmanaut.blogspot.com/
More information about the Greasemonkey
mailing list