Chrome / Firefox会立即在所有javascript onclick事件上设置断点 [英] Chrome/Firefox set breakpoint on all javascript onclick events at once

查看:133
本文介绍了Chrome / Firefox会立即在所有javascript onclick事件上设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试第三方HTML / Javascript页面,但我无法轻松找到脚本入口点来设置断点。

I am trying to debug a third-party HTML/Javascript page but I can't easily locate the script entry points to set breakpoints on them.

我想调试器打破任何元素的onclick事件处理程序。目前,如果页面设置为

I want the debugger to break on any element's onclick event handler. At the moment if the page is set up with something like

document.getElementById("foo").onclick = bar;

那么一般来说,确定foo和bar连接起来并不容易。

then in general it isn't easy to determine that foo and bar are connected.

所以,我想打破所有onclicks,无论他们在哪里。

So, I want to break on all onclicks, wherever they may be.

我可以在Chrome或Firefox中执行此操作吗?

Can I do this in Chrome or Firefox?

推荐答案

Chrome:

Chrome inspector -> sources -> Event Listener Breakpoints

Firefox:
get EventBug

您可以在这里阅读更多关于eventBug的信息:使用Firefox,如何监控所有JavaScript事件被解雇?

You can read a bit more about eventBug in here: Using Firefox, how can I monitor all JavaScript events that are fired?

这篇关于Chrome / Firefox会立即在所有javascript onclick事件上设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆