终极解决浏览器禁用f12
作者:互联网
document.onkeydown =
document.onkeyup =
document.onkeypress =
function (event) {
var e =
event ||
window.event ||
arguments.callee.caller.arguments[0];
if (e && e.keyCode == 123) { e.returnValue = false; return false; } };
var threshold = 160; // 打开控制台的宽或高阈值 // 每秒检查一次 window.setInterval(function () { if ( window.outerWidth - window.innerWidth > threshold || window.outerHeight - window.innerHeight > threshold ) { window.location.href = "https://i.cnblogs.com/"; } }, 1e3);
if (e && e.keyCode == 123) { e.returnValue = false; return false; } };
var threshold = 160; // 打开控制台的宽或高阈值 // 每秒检查一次 window.setInterval(function () { if ( window.outerWidth - window.innerWidth > threshold || window.outerHeight - window.innerHeight > threshold ) { window.location.href = "https://i.cnblogs.com/"; } }, 1e3);
标签:document,浏览器,threshold,window,arguments,f12,false,终极,event 来源: https://www.cnblogs.com/wt666/p/15661977.html