爬虫f12跳转和debugger检测

在空白页面的控制台运行解决重定向再复制url到网页

//解决重定向

bash 复制代码
(() => {

    window.onbeforeunload= ()=>{
        debugger;
        return false;
    }

})();

//构造方法无限debugger

bash 复制代码
(() => {

    Function.prototype.constructor = Function.prototype.constructor;
    Function.prototype.constructor = function(){
        if(arguments && typeof arguments[0] === 'string'){
            if ("debugger" === arguments[0]){
                return null
            }
            return Function.prototype.constructor_.apply(this,arguments);
        }
    }

})();

//药监局过debugger 在网站第二个debugger加载之前运行

var _constructor = constructor;

Function.prototype.constructor = function(s) {

if (s == "debugger") {

console.log(s);

return null;

}

return _constructor(s);

}

相关推荐
山河木马12 分钟前
矩阵专题2-怎么创建视图矩阵(uViewMatrix)
javascript·webgl·计算机图形学
tangdou3690986551 小时前
AI真好玩系列-2分钟快速了解DeepAgents | Quick Guide to DeepAgents in 2 Minutes
前端·javascript·后端
张元清1 小时前
React useIntersectionObserver Hook:懒加载与可见性检测(2026)
javascript·react.js
彭于晏爱编程2 小时前
纯 JS + Node,一个下午手搓了能读懂公司代码的 AI 助手,老板以为我转行了
前端·javascript
妙码生花3 小时前
从 PHP 到 AI + Golang,程序员自救转型手记(十四):眨眼小人登录页制作
前端·javascript·ai编程
妙码生花3 小时前
从 PHP 到 AI + Golang,程序员自救转型手记(十三):前端路由初始化
前端·javascript·ai编程
PBitW3 小时前
GPT训练我的第四天,被打惨了!!!😭😭😭
前端·javascript·面试
DarkLONGLOVE3 小时前
快速上手 Pinia!Vue3 极简状态管理使用教程
javascript·vue.js
mackbob3 小时前
.eslintrc.js详细配置说明
javascript
用户298698530145 小时前
在 React 中使用 JavaScript 将 Excel 转换为 PDF
javascript·react.js·webassembly