Created
April 13, 2020 11:06
-
-
Save akashsky44/2388707f00bfa3ab27d0c5494a337868 to your computer and use it in GitHub Desktop.
codeSecurity or Right Click and Ctrl+u disable
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
var codeSecurity = function() { | |
document.onkeydown = function(e) { | |
if (e.keyCode === 123 || (e.ctrlKey && | |
(e.keyCode === 67 || | |
e.keyCode === 115 || | |
e.keyCode === 99 || | |
e.keyCode === 85 || | |
e.keyCode === 117))) { | |
return false; | |
} else { | |
return true; | |
} | |
}; | |
document.addEventListener("contextmenu", function(e){ | |
e.preventDefault(); | |
}, false); | |
$(document).keypress("u",function(e) { | |
if(e.ctrlKey){return false;} | |
else {return true;} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment