Created
December 15, 2013 15:27
-
-
Save mtrojanowski/7974303 to your computer and use it in GitHub Desktop.
JS to block selecting text on a site.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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