asp.net 页面代码 if_前端页面禁止调试debugger方法汇总

9c072554d7ddd3fcc92e1d04fc81a972.png

打开控制台直接跳转页面

//debug调试时跳转页面
var element = new Image();
Object.defineProperty(element,'id',{get:function(){window.location.href="https://www.baidu.com"}});
console.log(element);

打开控制台,页面内容显示"检测到非法调试,请关闭后刷新重试!"

// 反调试函数,参数:开关,执行代码
function endebug(off, code) {
if (!off) {
! function (e) {
function n(e) {
function n() {
return u;
}

function o() {
window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized ? t("on") : (a = "off", console.log(d), console.clear(), t(a));
}

function t(e) {
u !== e && (u = e, "function" == typeof c.onchange && c.onchange(e));
}

function r() {
l || (l = !0, window.removeEventListener("resize", o), clearInterval(f));
}
"function" == typeof e && (e = {
onchange: e
});
var i = (e = e || {}).delay || 500,
c = {};
c.onchange = e.onchange;
var a, d = new Image;
d.__defineGetter__("id", function () {
a = "on"
});
var u = "unknown";
c.getStatus = n;
var f = setInterval(o, i);
window.addEventListener("resize", o);
var l;
return c.free = r, c;
}
var o = o || {};
o.create = n, "function" == typeof define ? (define.amd || define.cmd) && define(function () {
return o
}) : "undefined" != typeof module && module.exports ? module.exports = o : window.jdetects = o
}(), jdetects.create(function (e) {
var a = 0;
var n = setInterval(function () {
if ("on" == e) {
setTimeout(function () {
if (a == 0) {
a = 1;
setTimeout(code);
}
}, 200);
}
}, 100);
})
}
}

endebug(false, function () {
// 非法调试执行的代码(不要使用控制台输出的提醒)
// document.write("检测到非法调试,请关闭后刷新重试!");
document.write('

检测到非法调试,请关闭调试后刷新页面进行阅读!

');
});

参考

  1. 前端页面禁止调试debugger方法汇总: http://www.fly63.com/article/detial/8775

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值