总结一下无限debugger的过法
- 在
debugger
所在行加条件断点(Add conditional breakpoint)false
,但是一些网站会卡死
- 在
debugger
所在行右键选择never pause here
- 使用fd等工具替换源网页中的
debugger
关键字
- 使用chrome的
overrides
替换源js文件,修改debugger
相关代码
constructor
关键字启动的debugger
,注入代码,最好使用工具注入,浏览器控制台执行的话网页刷新会失效
(()=>{
Function.prototype.__constructor = Function.prototype.constructor;
Function.prototype.constructor = function (){
if (arguments && typeof arguments[0] === 'string'){
if ("debugger" === arguments[0]){
return
}
return Function.prototype.constructor.apply(this, arguments);
}
}
})()
Function
关键字启动的debugger
,注入代码
(()=>{
Function.prototype.__constructor = Function;
Function = function (){
if (arguments && typeof arguments[0] === 'string'){
if ("debugger" === arguments[0]){
return
}
return Function.apply(this, arguments);
}
}
})()
Function.prototype.constructor_bc = Function.prototype.constructor
Function.prototype.constructor = function() {
if (arguments[0] === "debugger") {}
else {
Function.prototype.constructor_bc.apply(this, arguments)
}
}
eval
关键字启动的debugger
,替换eval
函数
eval_bc = eval
eval = function(a) {
if (a === '(function() {var a = new Date(); debugger; return new Date() - a > 100;}())') {}
else {
return eval_bc(a)
}
}
- 定时器
debugger
,替换`setInterval`或者清除定时器,也可以使用7方法
setinval_b= setInterval
setInterval = function(a, b) {
if (a.toString().indexOf('debugger') == -1) {
console.log(a);
return setinval_b(a, b)
}
}
for (var i = 1; i < 99999; i++)window.clearInterval(i);