浏览器window.open跳转断点调试

By | 2025-04-09

打开F12开发者工具,粘贴以下代码

JavaScript
window.open = new Proxy(window.open, {
  apply: function(target, thisArg, args) {
    console.log('window.open 被调用了,参数如下:');
    console.log('URL:', args[0]);
    console.log('Target:', args[1]);
    console.log('Features:', args[2]);
    debugger;
    return Reflect.apply(target, thisArg, args);
  }
});
运行效果

Leave a Reply

Your email address will not be published. Required fields are marked *