正如你们中的一些人可能知道的那样,谷歌Chrome对Greasemonkey脚本有一些严重的限制.
铬不支持
@require,@resource,unsafeWindow,GM_registerMenuCommand,GM_setValue,或GM_getValue.
没有require,我找不到在Google Chrome下的Greasemonkey脚本中包含jQuery库的方法.
有人在这件事上有一些建议吗?
它一直说 $ 没有在 tamper-monkey 中定义,即使我已经 @require 了必要的链接。我究竟做错了什么?
// ==UserScript==
// @name New Userscript
// @author You
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @include https://www.google.com/
// ==/UserScript==
$(document).ready(function(){
console.log('ready');
});
Run Code Online (Sandbox Code Playgroud)