Last active
December 10, 2015 21:48
-
-
Save EvanHahn/4498026 to your computer and use it in GitHub Desktop.
Example page that does its best to disable copy-paste. For more: <http://evanhahn.com/?p=379>
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
-webkit-user-select: none; | |
-khtml-user-drag: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-o-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} | |
::selection { | |
background: transparent; | |
} | |
</style> | |
<script type="text/javascript"> | |
document.ondragstart = function() { return false }; | |
document.onselectstart = function() { return false }; | |
</script> | |
</head> | |
<body unselectable="on"> | |
<h1 unselectable="on">You can't select this!</h1> | |
<p unselectable="on">You can't select this either. <a href="http://evanhahn.com/" unselectable="on">You can't even select <i unselectable="on">this!</i></a></p> | |
</body> | |
</html> | |
<!-- Code licensed under the Unlicense. --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment