前端打开F12时暂停页面
前端打开F12时暂停页面
((function() {
var callbacks = [],
timeLimit = 50,
open = false;
setInterval(loop, 1);
return {
addListener: function(fn) {
callbacks.push(fn);
},
cancleListenr: function(fn) {
callbacks = callbacks.filter(function(v) {
return v !== fn;
});
}
}
function loop() {
var startTime = new Date();
debugger;
if (new Date() - startTime > timeLimit) {
if (!open) {
callbacks.forEach(function(fn) {
fn.call(null);
});
}
open = true;
window.stop();
document.body.innerHTML = "";
} else {
open = false;
}
}
})()).addListener(function() {
window.location.reload();
});
本文标题:前端打开F12时暂停页面
本文链接:https://www.haomeiwen.com/subject/seiiirtx.html
网友评论