-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsecurity.js
38 lines (33 loc) · 1.11 KB
/
security.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// this page attempts to stop use of source code viewing by easy chrome shortcuts
// the idea of this is to stop administrators from seeing the true nature of the site
// that being said you still can see the source code of the site pretty easily
// and i also don't want to obfuscuation
/*
document.addEventListener('contextmenu', event => event.preventDefault());
document.onkeydown = (e) => {
if (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey) {
switch (e.key) {
case "u":
e.preventDefault();
e.stopPropagation();
break;
case "i":
e.preventDefault();
e.stopPropagation();
break;
case "j":
e.preventDefault();
e.stopPropagation();
break;
}
}
if (e.key === "F12") {
e.preventDefault();
e.stopPropagation();
}
if (e.ctrlKey && e.shiftKey && (e.key === "I" || e.key === "J")) {
e.preventDefault();
e.stopPropagation();
}
};
*/