I just reincarnated this idea in a library fashion reusable from any user script type system, in the form of a function on(spec), towards the same end (gist:
https://gist.github.com/3886769 -- feel free to fork and tweak at will).
A Greasemonkey/dotjs usage example that makes comic strips clickable at
sinfest.net:
This utility might not strictly belong on GM-dev (it's not immediately proposing any core changes), but I figured I'd hail the crowd here that liked my initial variant on the same note, and maybe spur some innovation to improve and iterate on it.
There is some potential UX benefit of having Greasemonkey do this content-based filtering instead of script-side code, for purposes of showing a third state for a script in the monkey menu ("script would have run on this page, had the page not been missing these DOM elements: [named list of page elements the script required, that were not present]") – but behind that would be a somewhat large set of core changes, so this isn't on the GM roadmap quite yet, and might never get there either.
If you like the direction, though, start using this in your scripts, and/or tweaking it to your preferences so gets to evolve, mature and gain some traction first. If it doesn't, it's rather destined to go nowhere beyond here, however much I personally find it a much better way of writing page-mod type scripts than using the W3C APIs directly. :-)
I'm filing my own notes of stuff I want to fix or improve in
https://github.com/johan/user.js/issues/ for now, but the greasemonkey-users list is a fair place to chime in thoughts too if anyone feels chatty.
I'm intentionally just showing the tip of the iceberg in this post, as I tend to write a little too much in general. Happy hacking!
--
/ Johan Sundström