тна Back to MegaDB Search

whitewolfghost | 87 points | Jan 11 2018 20:37:42

[INFO/GUIDE] Remove BOLD using Javascript bookmark | Megalinks MegaDB [INFO/GUIDE] Remove BOLD using Javascript bookmark

I saw you can decode base64 using bookmark. So I attempted to remove bold letters with bookmark. I found this code. And I just did the cut and paste job. I am not a javascript programmer. I have only tested it in Chrome.

Remove Bold | Megalinks MegaDB Remove Bold: Use this to remove bold letters from selected string.

javascript:function c(){}function cleanHTML(e){var t=/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g,n=e.replace(t," "),o=new RegExp("\x3c!--(.*?)--\x3e","g"),n=n.replace(o,""),c=new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi");n=n.replace(c,"");for(var a=["strong","style","script","applet","embed","noframes","noscript"],r=0;r<a.length;r++)c=new RegExp("<"+a[r]+".*?"+a[r]+"(.*?)>","gi"),n=n.replace(c,"");for(var i=["style","start"],r=0;r<i.length;r++){var l=new RegExp(" "+i[r]+'="(.*?)"',"gi");n=n.replace(l,"")}return n}c.prototype.get=function(){var e="";if(void 0!==window.getSelection){var t=window.getSelection();if(t.rangeCount){for(var n=document.createElement("div"),o=0,c=t.rangeCount;o<c;++o)n.appendChild(t.getRangeAt(o).cloneContents());e=n.innerHTML}}else void 0!==document.selection&&"Text"==document.selection.type&&(e=document.selection.createRange().htmlText);return e},c.prototype.set=function(e){var t,e;if(window.getSelection&&window.getSelection().getRangeAt){(t=window.getSelection().getRangeAt(0)).deleteContents();var n=document.createElement("div");n.innerHTML=e;for(var o,c=document.createDocumentFragment();o=n.firstChild;)c.appendChild(o);t.insertNode(c)}else document.selection&&document.selection.createRange&&(t=document.selection.createRange(),e=3==node.nodeType?node.data:node.outerHTML,t.pasteHTML(e))};try{var d=new c,e=cleanHTML(d.get());d.set(e)}catch(e){alert(e.message)}

How to add these as bookmarks in Chrome

For testing | Megalinks MegaDB For testing: notbold | Megalinks MegaDB boldbold

Just incase someone wants the full Source Code:

function c()
{
}

// removes MS Office generated guff
function cleanHTML(input)
{
    // 1. remove line breaks / Mso classes
    var stringStripper = /(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g; 
    var output = input.replace(stringStripper, ' ');

    // 2. strip Word generated HTML comments
    var commentSripper = new RegExp('<!--(.*?)-->','g');
    var output = output.replace(commentSripper, '');
    var tagStripper = new RegExp('<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>','gi');

    // 3. remove tags leave content if any
    output = output.replace(tagStripper, '');

    // 4. Remove everything in between and including tags '<style(.)style(.)>'
    var badTags = ['strong', 'style', 'script','applet','embed','noframes','noscript'];

    for (var i=0; i< badTags.length; i++)
    {
        tagStripper = new RegExp('<'+badTags[i]+'.*?'+badTags[i]+'(.*?)>', 'gi');
        output = output.replace(tagStripper, '');
    }

    // 5. remove attributes ' style="..."'
    var badAttributes = ['style', 'start'];

    for (var i=0; i< badAttributes.length; i++)
    {
        var attributeStripper = new RegExp(' ' + badAttributes[i] + '="(.*?)"','gi');
        output = output.replace(attributeStripper, '');
    }

    return output;
}

c.prototype.get = function()
{
    var html = "";
    if (typeof window.getSelection != "undefined")
    {
        var sel = window.getSelection();
        if (sel.rangeCount)
        {
            var container = document.createElement("div");
            for (var i = 0, len = sel.rangeCount; i < len; ++i)
            {
                container.appendChild(sel.getRangeAt(i).cloneContents());
            }
            html = container.innerHTML;
        }
    }
    else if (typeof document.selection != "undefined")
    {
        if (document.selection.type == "Text")
        {
            html = document.selection.createRange().htmlText;
        }
    }
    return html;
};

c.prototype.set = function(html)
{
    var range, html;
    if (window.getSelection && window.getSelection().getRangeAt)
    {
        range = window.getSelection().getRangeAt(0);
        range.deleteContents();
        var div = document.createElement("div");
        div.innerHTML = html;
        var frag = document.createDocumentFragment(), child;
        while ( (child = div.firstChild) )
        {
            frag.appendChild(child);
        }
        range.insertNode(frag);
    }
    else if (document.selection && document.selection.createRange)
    {
        range = document.selection.createRange();
        html = (node.nodeType == 3) ? node.data : node.outerHTML;
        range.pasteHTML(html);
    }
};

try
{
    var d = new c;
    var e = cleanHTML(d.get());
    // alert(e);
    d.set(e)
}
catch(a)
{
    alert(a.message)
};

permalink


[-] lpjunior999 | 7 points | Jan 11 2018 21:11:48

This is interesting. I mostly browse on Android and just set up a way to decode base64 with Tasker, I'll have to try adding this.

permalink

[-] AabidS10 | 2 points | Jan 12 2018 13:38:45

Can you tell me the Tasker way?

permalink

[-] lpjunior999 | 2 points | Jan 12 2018 16:06:34

Tasker can convert variables to and from base64. I use a plugin app called AutoShare to grab the encoded link, decode it, and copy it my clipboard. I'll do a write-up sometime, I'd also like to find a way to make it remove letters, etc.

permalink

[-] duckwizzle | 1 points | Jan 17 2018 16:38:06

Do you also download on android?

permalink

[-] [deleted] | 7 points | Jan 11 2018 21:43:59

[deleted]

permalink

[-] MALON | 2 points | Jan 12 2018 02:38:37

I see nothing bypassing bold in here, am i wrong

permalink

[-] tyler_swift | 4 points | Jan 12 2018 01:57:24

Where can this be useful? Honestly asking.

permalink

[-] ruralcricket | 6 points | Jan 12 2018 03:25:27

Some posters add a couple of B | Megalinks MegaDB Bold letters to the mega link or key and ask you to remove them as part of confusing the DMCA bots. Of course after cutting & pasting into a URL, they are no longer bold...

permalink

[-] tyler_swift | 1 points | Jan 12 2018 04:22:29

I see, thanks.

permalink

[-] xipharg | 1 points | Jan 12 2018 04:42:10

wouldn't it be fairly easy for a bot scraping the sub for links to simply throw out the those characters enclosed in strong tag?

permalink

[-] Pissymon | 5 points | Jan 12 2018 05:36:20

Yeah, pretty much. People like to think they are so smart and genius by coming up with these "methods," but in reality, really all they are doing is delaying their demise.

permalink

[-] prometheus371 | 9 points | Jan 12 2018 06:33:38

isnt that the point though? to delay the death of the link?Even if its just for a little bit?

permalink

[-] xipharg | 3 points | Jan 12 2018 09:23:43

maybe, but it's a very simple addition if they pay any attention to this sub at all. Someone who can create a proper bot to mine these links can probably update it to work around this in a couple of minutes.

permalink

[-] un10able | 3 points | Jan 11 2018 22:46:56

you, I like you

permalink

[-] cyberdoggy | 1 points | Jan 12 2018 01:44:13

Perfect just what I needed thanks!

permalink

[-] mteg | 1 points | Jan 12 2018 18:26:39

Thanks a lot, that's really great (especially because it leaves everything but the bold in place, without having to open a dialog like the base64 javascript bookmark I've been using.

permalink

[-] HTPC- | 1 points | Jan 13 2018 16:41:08

Dude this is awesome!! thanks very much. Between this and now the b64 addon I have, decrypting links is a breeze!

again, thanks!

permalink

[-] Mr_Soupe | 1 points | Jan 21 2018 15:47:38

This thread should be pinned up for ever on r/Megalinks ...

permalink