您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
write once run anywhere,注入jQuery,方便控制台调试代码
当前为
// ==UserScript== // @name Any jQuery,页面注入jQuery,方便控制台调试代码 // @namespace http://bbs.91wc.net/any-jquery.htm // @version 0.2 // @description write once run anywhere,注入jQuery,方便控制台调试代码 // @author Wilson // @match http*://*/* // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js // @resource jquery https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js // @grant unsafeWindow // @grant GM_getResourceText // ==/UserScript== //main function main() { //Your codes here //你也可以像这样向页面中写全局变量或函数 //_g.a="test a"; //_g.b = function(){ // console.log("test b"); //} } //注入jQuery和全局变量_g this.$ = this.jQuery = jQuery.noConflict(true); $("body").append('<script id="_g_script">var _g=window, _w=_g, _jq=(typeof jQuery === "undefined") ? null : jQuery;</script>'); var init = function(){ //初始化_jq变量 _g._jq = _g.jQuery; _g._jq.version=_g._jq.fn.jquery; //call main main(); }; if(_g._jq === null){ setTimeout(function(){ //动态设置jQuery var jq_code = GM_getResourceText('jquery'); $("body").append('<script id="_g_jquery">'+jq_code+'</script>'); //初始化_jq变量 init(); }, 0); } else { //初始化_jq变量 init(); }