Skip to content

Instantly share code, notes, and snippets.

@mtrojanowski
Created December 15, 2013 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtrojanowski/7974303 to your computer and use it in GitHub Desktop.
Save mtrojanowski/7974303 to your computer and use it in GitHub Desktop.
JS to block selecting text on a site.
//courtesy of BoogieJack.com
function killCopy(e) {
return false;
}
function reEnable() {
return true;
}
document.onselectstart = new Function ("return false")
if (window.sidebar) {
document.onmousedown=killCopy;
document.onclick=reEnable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment