替换debug

_setInterval = setInterval
setInterval = function setInterval(code, time){
    console.log(code, time)
    code = code.toString().replace(/debugger/, "").replace(/function ()/, "function aaa")
    return window._setInterval(new Function(code) , time)
}
_setTimeout = setTimeout
setTimeout = function setTimeout(code, time){
    console.log(code, time)
    code = code.toString().replace(/debugger/, "").replace(/function ()/, "function aaa")
    return window._setTimeout(new Function(code), time)
}

 

上一篇:跟我学浏览器事件环


下一篇:vue添加防斗