使用Chrome的Webkit检查器删除事件侦听器 [英] Use Chrome's webkit inspector to remove an event listener

查看:363
本文介绍了使用Chrome的Webkit检查器删除事件侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道你可以在Chrome Inspector中看到事件监听器,但我正在做一些调试工作,并且周围有太多的事件监听器,我想禁用一些代码而不编辑代码。





也许有一种方式可以在控制台中输入一些代码到 removeEventListener 监听器?我将如何做到这一点?例如,如何删除上面的'click'侦听器?

解决方案

对不起,你运气不好) removeEventListener 要求确切的侦听器函数对象作为参数,DevTools不会让您以任何方式掌握侦听器函数。



如果您确实需要此功能,请在 http://new.crbug上提交错误。 (针对Chrome)或 http://bugs.webkit.org (针对WebKit,首选方式)。


I know you can see the event listeners in the Chrome Inspector but i'm doing some debugging work and there are so many event listeners lying around I'd like to disable some without editing the code

Is there a way to disable an event listener quickly from the Webkit inspector?

Perhaps have a look and type some code into the console to removeEventListener the listener? How would I do this? For instance how would i remove the 'click' listener above

解决方案

Sorry, you are out of luck (at least for the time being.) removeEventListener requires the exact listener Function object as an argument, and DevTools do not let you get a grip of the listener function in any way.

If you definitely need this feature, please file a bug at http://new.crbug.com (against Chrome) or http://bugs.webkit.org (against WebKit, the preferred way).

这篇关于使用Chrome的Webkit检查器删除事件侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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