showing results for - "disable inspector"
Juliana
17 Aug 2016
1/* It's possible, but this would block the following commands:
2 * Right Click (entirely!)
3 * F12
4 * Ctrl + Shift + I
5 * Ctrl + Shift + J
6 * Ctrl + Shift + C
7 * Ctrl + U
8*/
9
10// Right click
11<body oncontextmenu="return false">
12
13// Keys
14document.onkeydown = function(e) {
15  if(event.keyCode == 123) {
16     return false;
17  }
18  if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
19     return false;
20  }
21  if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
22     return false;
23  }
24  if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
25     return false;
26  }
27  if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
28     return false;
29  }
30}