-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheh
32 lines (25 loc) · 906 Bytes
/
heh
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
<script>
// Disable right-click
document.addEventListener("contextmenu", (e) => e.preventDefault());
// Disable F12, Ctrl+Shift+I, Ctrl+Shift+C, and Ctrl+Shift+J
document.addEventListener("keydown", (e) => {
if (
e.key === "F12" ||
(e.ctrlKey && e.shiftKey && (e.key === "I" || e.key === "C" || e.key === "J")) ||
(e.ctrlKey && e.key === "U") // Disable Ctrl+U (View Source)
) {
e.preventDefault();
}
});
// Prevent opening DevTools using right-click or shortcuts
let checkDevTools = () => {
setTimeout(() => {
if (window.outerHeight - window.innerHeight > 100 || window.outerWidth - window.innerWidth > 100) {
alert("Developer tools are disabled on this website.");
window.close(); // Close the window if possible
}
checkDevTools();
}, 500);
};
checkDevTools();
</script>