CopyLight is an experimental jQuery plugin that allows websites to emphasize the licensing terms of their content, if a user has selected a substantial amount of it on a page. (What constitutes a "substantial" selection is customizable, but defaults to 256 characters.) The license terms are emphasized without making text selections brittle or unreliable...nor is attribution injected to the clipboard without the user's consent (as is done by systems like "Tynt").
When a large enough selection happens to trigger the plugin, a color-coded "stoplight button" appears. This button is placed as near as possible to the point of selection to make it easy to click and to see what it is attached to. Pushing the button brings up a dialog which provides a reminder of the site's license terms, and also gives a convenient URL to share with an easy one-click copy. Yet the final decision is left to the user; and browser functionality for copying is not interfered with.
Although CopyLight can be used to draw a page visitor's attention to a "red light" licensing restriction, it can also emphasize "green light" or "yellow light" freedoms governing content that uses Creative Commons licenses.
Overview Video
Live Demo
There are currently two demos that you can try to see how they work:
Please remember that the code is experimental. However, if you notice any problems you can report them at the GitHub issue tracker.
Source
Copylight is available under a permissive MIT license and is on GitHub.
As mentioned, the code is experimental. Please feel free to offer feedback or adapt the resources to your own purposes.
Backstory
The plugin was created to address a problem on the web, which are sites that disable the text selection feature of your browser. This means if you want to quote even just a word or sentence you are reading, you must either retype it or send a link to the entire page. Sites do this because if they let you copy a relevant portion to send to a friend or quote on a blog, that audience won't be forced to visit the site you copied from.
At one point this was limited to sites known for pop-ups, malware, and other bad practices (such as those offering song lyrics, which they did not author or type in). But the phenomenon spread to otherwise reputable sites that actually create their own content, such as Snopes. They felt justified as copyright owners that the only way to enforce their license was to break your browser as collateral damage. In a 2011 e-mail confrontation with me, Snopes in particular argued that allowing people to take the information out of context was interfering with their mission of stopping rumors.
Yet as one of the technologists who builds infrastructure like what organizations like Snopes used to find an audience in the first place, I take this kind of abuse of software personally. The extension mechanisms that allow for hooks into the browser were not put there so they could hinder the user experience. And this line of thinking is what the Electronic Frontier Foundation very rightfully calls "Defective By Design". How would Snopes have liked it if the software they used to make their site had refused to allow them to copy-and-paste from the rumors they were investigating, instead making them retype it?
For those not tech-savvy enough to find a workaround, this is a matter of deliberately crippling the web browser. It also tramples on the doctrine of Fair Use. CopyLight was a reaction to show that there are reasonable alternatives, and to demonstrate one such idea.
UPDATE 14-Feb-2014
Snopes no longer disables selection or copying, but rather splices an attribution link into the copied content. I think that's kind of annoying too, yet not as egregious as what they were doing before. Apparently reason prevailed--and possibly due to a petition on change.org. CopyLight could still be applicable to similar circumstances and concerns, however.
How Do Websites Disable Text Selections?
There are a number of ways to disable text selections, but all of them involve running some JavaScript code. Some techniques even interfere with your overall mouse functioning...disallowing right click menus etc. For even a novice JavaScript programmer, the techniques are well known and trivially simple to implement.
Some programmers have good intentions, and use the technique in the best interest of the user interface. For instance they might want to disable selections on a part of a page if the selection would be almost certainly accidental and create a confusing visual effect. Disabling a right click pop-up menu could be useful if they are making an interesting game and want to use the right mouse button for something else.
However, disabling the browser ability to copy selections is not an example of using this technique in good faith.