JSFiddle - React, Tailwind, and code Playground

full urls as link text_ifContainsURLsubstringBlackList_v03

by dledle2

HTML

full urls as link text_ifContainsURLsubstringBlackList_v03

JavaScript

javascript_:(function() {
             var i, c, x, h;


if (typeof String.prototype.myFunc_EndsWith !== 'function') {
    String.prototype.myFunc_EndsWith = function(suffix) {
        return this.indexOf(suffix, this.length - suffix.length) !== -1;
    };
}



            /* if(  window.top.location.hostname.toLowerCase().contains('mozilla.org')   ){                                             */
            /*   alert('you must paste this manually into the console due to hardcoded content security policy for SCRIPT SRC');      */
            /* }                                                                                                                       */

             for (i = 0; x = document.links[i]; ++i) {

             if (! (x.href.toLowerCase().contains('?c=')   || x.href.myFunc_EndsWith('/')    )   ){
                console.log('using a URL because it was not blacklisted: ' +  x.href);
                h = x.href;
                x.title += " " + x.innerHTML;
                 c = x.firstChild ;
                while (c == x.firstChild) x.removeChild(c);
                x.appendChild(document.createTextNode(h));
             }
            else{
             /* console.log('excluding URL because it WAS blacklisted: ' +  x.href); */
            }




             }
             })()void(0);