3 ms·
Cool, I love counterintuitive (and even counterproductive) solutions just for their own sake. I tried to do a similar thing with text a while ago: http://nbush.
by nbush 12y ago
Cool, I love counterintuitive (and even counterproductive) solutions just for their own sake. I tried to do a similar thing with text a while ago: http://nbush.github.io/headache/ http://nbush.github.io/headache/
- awhitty 12y agoThis is clever! I think it can be circumvented by removing all spans in a paragraph with more than 1 character.
- nbush 12y agoThanks! Yeah, there are many JS ways around this, but it would be more than enough to stop most people... including myself in most cases.
- fabrixxm 12y ago"Tired of people stealing your content? Looking to make copying HTML text a huge pain for your users? Sick and tired of useful, well-made Python scripts? Headache will make it so users cannot select, copy or paste html text without getting a bunch of garbage as well. Try copying this sentence. No, seriously, try it. Yeah that's right. Now try pasting it somewhere. Now the only way you can steal my sweet, sweet content is by writing it out letter by letter or writing your own noble script that filters out all the junk. Checkmate. You might say that this solution is unintuitive, massively inefficient and completely unnecessary. Well that's not the true Hacker Spirit now, is it? " ;)
- abbeyj 12y agoAs a challenge I wanted to see how hard it would be to circumvent this. Here's a bookmarklet: javascript:void(function(s,i){for(i=0;i<s.length;i++)if(window.getComputedStyle(s[i]).color=='transparent')s[i].style.display='none'}(document.getElementsByTagName('span'))) That should be one line with no spaces if gets line wrapped.
- nbush 12y agoNice work! Here's another solution posted in an earlier thread: javascript:d=document.createElement("div");d.innerHTML="<style>span:nth-child(odd) {display:none;}</style>";document.body.appendChild(d); I don't think there's any easy way for the obfuscation to stay ahead of JS reversal. Thanks for taking a look!