Skip to content

Instantly share code, notes, and snippets.

@dasbairagya
Last active October 22, 2018 18:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dasbairagya/c457cb0a2a815d8e751760677c9765bb to your computer and use it in GitHub Desktop.
Save dasbairagya/c457cb0a2a815d8e751760677c9765bb 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