Created
October 23, 2019 13:24
-
-
Save eoikonomou/441eb471da6689c68fb08df310cc6581 to your computer and use it in GitHub Desktop.
Disable developer tools
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
document.onkeydown = function (event) { | |
if (event.keyCode == 123) { // Prevent F12 | |
return false; | |
} else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { // Prevent Ctrl+Shift+I | |
return false; | |
} | |
}; | |
// Hides context menu on right click of the mouse to prevent right click - inspect | |
document.oncontextmenu = function (e) { | |
e.preventDefault(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment