如何禁用调试器; JS命令?

时间:2019-06-25 10:34:52

标签: javascript debugging

window.alert = function(msg){console.log('foo' + msg);};
alert("bar");
  

foobar

Chrome控制台的屏幕截图:

enter image description here

我的问题是,如果我尝试与此禁用debugger;命令,则不起作用:

window.debugger = function(){console.log('faa');};
debugger;

当我运行debugger;时,断点将停止我的应用。

1 个答案:

答案 0 :(得分:0)

debugger不是window的成员,它只是浏览器知道停止在调试模式下的标志。