Skip to content

Commit 786241c

Browse files
authored
Merge pull request #16 from pythonzm/feature/debug
nodebug放在index.html
2 parents c45ac90 + 5c4771d commit 786241c

File tree

2 files changed

+31
-22
lines changed

2 files changed

+31
-22
lines changed

fronted/public/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,23 @@
1919
</noscript>
2020
<div id="app"></div>
2121
<!-- built files will be auto injected -->
22+
<script>
23+
var minimalUserResponseInMiliseconds = 200
24+
function check() {
25+
console.clear()
26+
var before = new Date().getTime()
27+
debugger; var after = new Date().getTime()
28+
if (after - before > minimalUserResponseInMiliseconds) {
29+
document.write(' Bingo. ')
30+
self.location.replace(window.location.protocol + window.location.href.substring(window.location.protocol.length))
31+
} else {
32+
before = null
33+
after = null
34+
}
35+
setTimeout(check, 100)
36+
}
37+
38+
check()
39+
</script>
2240
</body>
2341
</html>
Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1-
var minimalUserResponseInMiliseconds = 200
2-
function check() {
3-
console.clear()
4-
var before = new Date().getTime()
5-
debugger; var after = new Date().getTime()
6-
if (after - before > minimalUserResponseInMiliseconds) {
7-
document.write(' Dont open Developer Tools. ')
8-
self.location.replace(window.location.protocol + window.location.href.substring(window.location.protocol.length))
9-
} else {
10-
before = null
11-
after = null
12-
}
13-
setTimeout(check, 100)
14-
}
15-
16-
check()
17-
181
window.onload = function() {
192
document.addEventListener('contextmenu', function(e) {
203
e.preventDefault()
214
}, false)
225
document.addEventListener('keydown', function(e) {
23-
if (e.ctrlKey && e.shiftKey && e.code === 73) {
6+
if (e.ctrlKey && e.shiftKey && e.code === 'KeyI') {
247
disabledEvent(e)
258
}
26-
if (e.ctrlKey && e.shiftKey && e.code === 74) {
9+
if (e.ctrlKey && e.shiftKey && e.code === 'KeyJ') {
2710
disabledEvent(e)
2811
}
29-
if (e.code === 83 && (navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey)) {
12+
if (e.ctrlKey && e.shiftKey && e.code === 'KeyC') {
3013
disabledEvent(e)
3114
}
32-
if (e.ctrlKey && e.code === 85) {
15+
if (e.code === 'KeyS' && (navigator.userAgent.match('/Macintosh/i') ? e.metaKey : e.ctrlKey)) {
3316
disabledEvent(e)
3417
}
35-
if (e.code === 123) {
18+
if (e.ctrlKey && e.code === 'KeyU') {
19+
disabledEvent(e)
20+
}
21+
if (e.code === 'F12') {
3622
disabledEvent(e)
3723
}
3824
}, false)
@@ -45,4 +31,9 @@ window.onload = function() {
4531
e.preventDefault()
4632
return false
4733
}
34+
window.addEventListener('resize', function() {
35+
if ((window.outerHeight - window.innerHeight) > 100) {
36+
document.write('Bingo')
37+
}
38+
})
4839
}

0 commit comments

Comments
 (0)