Greasemonkey @require jQuery not working “Component not available”

前端 未结 8 2112
温柔的废话
温柔的废话 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:13

    I found a non-ideal way to use it with jQuery 1.4.1 -- this seems to fix it. It's the new browser sniffing that seems to "break" it.

    jquery-1.4.1.min.js:

      [old]  36: var o=r.createElement("div");n="on"+n;var m=n in o;
      [new]  36: var o=r.createElement("div");n="on"+n;var m=true;
    

    jquery-1.4.1.js

      [old] 934: var isSupported = (eventName in el);
      [new] 934: var isSupported = true;
    

提交回复
热议问题