Disable ways to open Inspect Element in JavaScript and HTML

Introduction

I wrote a 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;
}
}


Comments

Popular posts from this blog

Import, restore, or back up contacts in google

Whatsapp Floating icon in HTML

How to Set FileZilla to Open and Edit Files with Notepad++