Skip to content

Instantly share code, notes, and snippets.

@spatialy
Forked from dasbairagya/disable.js
Created October 22, 2018 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spatialy/f6bcfb86a329ca3f5ca694662fcba0c5 to your computer and use it in GitHub Desktop.
Save spatialy/f6bcfb86a329ca3f5ca694662fcba0c5 to your computer and use it in GitHub Desktop.
Script to disable the right click and inspect elemt of any browser :
$(document).keydown(function(e) {
return 123 == e.keyCode ? !1 : e.ctrlKey && e.shiftKey && 73 == e.keyCode ? !1 : void 0
}), document.addEventListener("contextmenu", function(e) {
e.preventDefault()
}), document.onkeydown = function(e) {
return !e.ctrlKey || 67 !== e.keyCode && 86 !== e.keyCode && 85 !== e.keyCode && 117 !== e.keyCode ? !0 : !1
}, $(document).keypress("u", function(e) {
return e.ctrlKey ? !1 : !0
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment