I'm newbie to JS/Greasemonkey and have some difficulty debugging this 
script:


*N.B.:* The script parse the HTML of the site, find the SCRIPT tag and 
change the content of the script before it run.

// ==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]
] );


It throw me in the console: "too much recursion"


<http://i.imgur.com/x6rj73t.png>

http://i.imgur.com/x6rj73t.png


<http://i.imgur.com/x6rj73t.png>


<http://i.imgur.com/x6rj73t.png>

Then point to: 
https://greasyfork.org/scripts/12317-checkforbadjavascripts-js/code/checkForBadJavascriptsjs.js
 
<https://greasyfork.org/en/scripts/12317-checkforbadjavascripts-js/code/checkForBadJavascriptsjs.js>
 
file 

<http://i.imgur.com/F9agQMT.png>

http://i.imgur.com/F9agQMT.png

.

The last error *"ReferenceError: initTinyMCE is not defined"* seem to be 
caused because of the first 2 errors.

`

>From here: 
http://stackoverflow.com/questions/11200509/how-to-alter-this-javascript-with-greasemonkey
 
everything should work fine in the script. 


*I don't see why I have those 2 "too much recursion" errors ????*



-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to