Prevent content copying nicely with a friendly 'no copy' script
It's miserable. There isn't any way to slice it. Hobbling browsers to keep people from copying your precious content is lame.
During my tenure at GateHouse Media (newspaper company), I was asked to create & implement a script that would stop people from copying the content from our articles.
"It's ludicrous", I said. If they're driven enough, people will find a way. Why mock them further?
Naturally, I wanted to continue receiving a paycheck, so once I got tired of protesting, I set about implementing a block of code that would put a halt to the keyboard and mouse inputs related to cutting/copying content.
It was not a friendly solution, but the editors were sated.
Now it's been a couple of years, and I've refined the solution a bit to make it less intrusive to the visitor's experience on the site. Here are a few caveats:
- It aspires to prevent content copying. This is not a cure-all. This is an obstacle.
- It doesn't cover the full range of browsers. I've only tested it in Safari, Chrome & Firefox on Mac.
- It's JavaScript based, so if a user has turned off JS, then they have free reign.
What makes it friendly?
It doesn't disable functionality outright. It assumes that if you don't have any text highlighted, then you're probably not a bad guy.
Kudos to Quirksmode.org for his Introduction to Range.
Let me know if you use it by leaving a comment below.
If it breaks or doesn't help, let me know. I'm interested in keeping this relevant.
If you enjoyed this post, then tweet about it!