Re:How to prevent screenshots in a web browser
by nbush on Monday July 14, 2014 @12:36PM
(#8031717)
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/
[ Parent
| on HN ]
Re:How to prevent screenshots in a web browser
by fabrixxm on Monday July 14, 2014 @01:01PM
(#8031876)
"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? " ;)
Re:How to prevent screenshots in a web browser
by abbeyj on Monday July 14, 2014 @01:33PM
(#8032072)
As 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.
Nice 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!