Created
January 28, 2018 08:47
-
-
Save OkoyaUsman/32345bbd62294f862c52e3190ff27b85 to your computer and use it in GitHub Desktop.
Disable Right Click In JavaScript
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> | |
<meta charset="utf-8"> | |
<title>Github</title> | |
</head> | |
<body> | |
<script language="javascript"> | |
var message=""; | |
function clickIE() {if (document.all) {(message);return false;}} | |
function clickNS(e) {if | |
(document.layers||(document.getElementById&&!document.all)) { | |
if (e.which==2||e.which==3) {(message);return false;}}} | |
if (document.layers) | |
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} | |
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} | |
document.oncontextmenu=new Function("return false") | |
</script> | |
<h1>You can't copy the Github Community</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment