Wednesday, 24 October 2018

Disable ways to open Inspect Element in JavaScript and HTML.

Script that disables practically all the ways to access Inspect Element in JavaScript. Here's what it blocks:

  • Right Click
  • F12
  • Ctrl + Shift + I
  • Ctrl + Shift + J
  • Ctrl + U

What you need?

  • Basic JavaScript knowledge
  • HTML editor

What you do?

  • Right Click
  • Copy the HTML below!

Keys :

Copy the JavaScript below!

document.onkeydown = function(e) {
if(event.keyCode == 123) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
return false;
}
}


No comments:

Post a Comment