[Greasemonkey] GM presentation

Edward Lee edilee at gmail.com
Fri Aug 5 11:16:28 EDT 2005


"Obvious JavaScript techniques don't work" -> Pitfall #3: named forms

It's not really a javascript issue, but a DOM issue, I believe. It's
like the document.all support added to Firefox even though it's not a
specification from the w3c. Yes, it does make scripts work across
browsers, but it doesn't make it standard. XHTML is quite strict, and
learning that could be useful for someone so that they don't get
sloppy.

Other things that you point out like pitfall #1 (auto-eval strings)
and pitfall #2 (event handlers) are probably for the better. Auto-eval
strings failed in previous versions of greasemonkey because of the
function wrapper preventing the global scope from getting polluted,
and that's good incase there are sloppy scripts on the page taking up
global namespace. Same thing for the event handlers because writing to
the onclick will overwrite other eventlisteners, and addEventListener
allows multiple events to trigger.

So perhaps they are pitfalls, but you could also mention that it'll
improve the quality of scripts.. maybe :p It's like writing programs
in languages with different warning/error settings. Greasemonkey 1.5
turned on the strict flag ;)

-- 
Ed


More information about the Greasemonkey mailing list