javascript - Firefox 开发者版获取注册在元素 getEventListeners 上的所有事件监听器

标签 javascript firefox developer-tools

我想在开发人员工具控制台中的 JavaScript 中获取在元素上注册的所有事件监听器。

在 Chrome 中,getEventListeners(domElement)存在。

在 Firebug 中,这显然也存在。 Firebug 已停产。我找到了this article其中说:

So it’s sad that Firebug is now reaching end-of-life in the Firefox browser, with the release of Firefox Quantum (version 57) next month. The good news is that all the capabilities of Firebug are now present in current Firefox Developer Tools.



强调我的。

但是,getEventListeners在我安装的 Firefox Developer Edition 78.0b3 中不起作用。

那么如何获取在控制台元素上注册的事件监听器列表呢?

最佳答案

根据这个页面:https://bugzilla.mozilla.org/show_bug.cgi?id=1164285正在处理中,所以 getEventListeners尚未在新的 Firefox 中实现。

可以在 Inspector 中找到该元素。面板,右侧有一个 event按钮,显示事件监听器。您可以检查它们并在代码中找到它们的位置。

关于javascript - Firefox 开发者版获取注册在元素 getEventListeners 上的所有事件监听器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62216504/

相关文章:

google-chrome - 远程调试时 Chrome 检查器问题

javascript - jQuery 数据表 ASP.NET 问题

javascript - .map 在功能性 React 组件的返回中不起作用

twitter-bootstrap - Bootstrap 3.2.0 与 Bootstrap 3.3.7,Carousel CSS3 3D 转换

firefox - 仅在 Firefox 中应用框阴影时图像像素化

javascript - 对象值更改时在 Web 浏览器中停止调试器

javascript - 让垂直滚动条始终存在 css

javascript - 在 ajax 添加到 Woocommerce 中的购物车事件后运行 javascript 代码

javascript - Mozilla Firefox 中未触发事件回调

google-chrome - 如何在Chrome开发者工具的网络选项卡中默认启用 "Preserve Log"?