我的新手到JS/Greasemonkey的,并有一定的难度调试这个脚本:太多的递归错误使用checkForBadJavascripts()
注:脚本解析网站的HTML,找到SCRIPT标签和更改脚本运行之前的内容。
// ==UserScript==
// @name JustPaste.it CheckForBadScript
// @namespace Mkhoul
// @description Test 01
// @include https://justpaste.it/*
// @version 1
// @require https://greasyfork.org/scripts/12317-checkforbadjavascripts-js/code/checkForBadJavascriptsjs.js?version=73234
// @run-at document-start
// @grant GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
introduced in GM 1.0. It restores the sandbox. MIKE MIKE MIKE
*/
function replaceTargetJavascript (scriptNode) {
var scriptSrc = scriptNode.textContent;
scriptSrc = scriptSrc.replace (
"meta,script,object,applet,iframe,option,embed,span[size|face],pre,font[style|face],h2[style],h1[style],h3[style],h[style],input,textarea,submit",
"dummyoption"
);
addJS_Node (scriptSrc);
}
checkForBadJavascripts ([
[false, /invalid_elements/, replaceTargetJavascript]
]);
它把我扔在控制台: “太多递归”
然后指向:https://greasyfork.org/scripts/12317-checkforbadjavascripts-js/code/checkForBadJavascriptsjs.js文件
。
最后一个错误“ReferenceError:initTinyMCE未定义”似乎是由于前2个错误引起的。
`
从这里:How to alter this javascript with Greasemonkey?一切都应该在脚本中很好地工作。
我不明白为什么我有那些2“太多的递归”错误?