whitewolfghost | 87 points
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.
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
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)
};
[-] [deleted] | 7 points
[-] tyler_swift | 4 points
Where can this be useful? Honestly asking.
[-] ruralcricket | 6 points
Some posters add a couple of
[-] tyler_swift | 1 points
I see, thanks.
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?
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.
[-] prometheus371 | 9 points
isnt that the point though? to delay the death of the link?Even if its just for a little bit?
[-] cyberdoggy | 1 points
Perfect just what I needed thanks!
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.
Dude this is awesome!! thanks very much. Between this and now the b64 addon I have, decrypting links is a breeze!
again, thanks!
[-] 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