Greasemonkey @require jQuery not working “Component not available”

前端 未结 8 2114
温柔的废话
温柔的废话 2020-12-16 19:41

I\'ve seen the other question on here about loading jQuery in a Greasemonkey. Having tried that method, with this require statement inside my ==UserScript== tag

相关标签:
8条回答
  • 2020-12-16 20:33

    Good news and updating all postings:

    The above patch allowed pre-1.5.2 jQuery versions to be run in Greasemonkey scripts, but fortunately the patch is no longer required if you use the current jQuery 1.5.2 version.

    I checked its code and noticed that the eventSupported function code in jQuery

    var eventSupported = function(eventName) { ... }
    

    has been updated with the consequence that unpatched jQuery 1.5.2 now runs in Greasemonkey 0.9.2.

    0 讨论(0)
  • 2020-12-16 20:34

    I was stumbling around trying to deal with this issue with GM 0.8 and jquery 1.4.2 and found this: http://forum.jquery.com/topic/importing-jquery-1-4-1-into-greasemonkey-scripts-generates-an-error

    It looks to me like the definitive answer to the question and how to work around it. The workaround worked for me.

    0 讨论(0)
提交回复
热议问题