相关疑难解决方法(0)

如何在Google Chrome中的Greasemonkey脚本中使用jQuery?

正如你们中的一些人可能知道的那样,谷歌Chrome对Greasemonkey脚本有一些严重的限制.

铬不支持@require,@resource,unsafeWindow,GM_registerMenuCommand,GM_setValue,或GM_getValue.

没有require,我找不到在Google Chrome下的Greasemonkey脚本中包含jQuery库的方法.

有人在这件事上有一些建议吗?

jquery greasemonkey google-chrome require userscripts

155
推荐指数
6
解决办法
6万
查看次数

无法在 tampermonkey 中使用 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)

jquery tampermonkey

1
推荐指数
1
解决办法
4362
查看次数