Importing jQuery 1.4.1 into greasemonkey scripts generates an error
Hi, I realise this is more of a glitch with greasemonkey rather than jQuery, but I thought I would post the info here anyway.
Greasemonkey has an API called @require which can import a javascript library when the userscript is installed.
http://wiki.greasespot.net/Metadata_block#.40requireUnfortunately the latest version of jQuery (1.4.1) seems to be incompatible.
The problem seems to be with "detecting-event-support-without-browser-sniffing" section around line 930. If you change
- var isSupported = (eventName in el);
to
- var isSupported = true;
it seems to import ok.
Again, I realise this isn't really a problem with jQuery so much as with perhaps Greasemonkey - I was just hoping you could maybe add a check to see if jQuery is being used in Greasemonkey. Maybe something like:
- if(GM_log) return true;