Last active
April 23, 2018 04:21
-
-
Save Illusionist3886/29014ad775cb989822397f05dbb24be4 to your computer and use it in GitHub Desktop.
Disable Right Click and Ctrl+U
This file contains 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
<html lang="en" oncontextmenu="return false" onselectstart="return false" ondragstart="return false"> | |
<body> | |
<!-- Your Code Goes Here --> | |
<script> | |
document.onkeydown = function(e) { | |
if (e.ctrlKey && | |
(e.keyCode === 67 || | |
e.keyCode === 86 || | |
e.keyCode === 85 || | |
e.keyCode === 117)) { | |
alert('You are not allowed to perform this action.'); | |
return false; | |
} else { | |
return true; | |
} | |
}; | |
</script> | |
<script src="yourpath/jquery.js"></script> | |
<script> | |
$(document).bind('keydown', function(e) { | |
if(e.ctrlKey && (e.which == 83)) { | |
e.preventDefault(); | |
alert('You cannot save this page'); | |
return false; | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment