-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity.js
More file actions
38 lines (33 loc) · 1.02 KB
/
Copy pathsecurity.js
File metadata and controls
38 lines (33 loc) · 1.02 KB
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
(function () {
let devtoolsOpen = false;
const threshold = 160;
setInterval(() => {
if (window.outerWidth - window.innerWidth > threshold ||
window.outerHeight - window.innerHeight > threshold) {
if (!devtoolsOpen) {
devtoolsOpen = true;
fetch("/report.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type: "devtools_open",
time: Date.now()
})
});
}
} else {
devtoolsOpen = false;
}
}, 1000);
// detect console usage
const element = new Image();
Object.defineProperty(element, 'id', {
get: function () {
fetch("/report.php", {
method: "POST",
body: JSON.stringify({ type: "console_detected" })
});
}
});
console.log(element);
})();