如何在点击第三方按钮时设置断点? [英] How to set a breakpoint on clicking a 3rd party button?

查看:299
本文介绍了如何在点击第三方按钮时设置断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试第三方小部件( +1按钮)。具体来说,我想在Chrome中设置一个断点,当点击小部件中的按钮时停止。

I'm trying to debug a 3rd party widget (+1 button to be exact). Specifically, I'd like to set a breakpoint in Chrome that stops when a button in the widget is clicked.

我想打破第三方代码处理到点击事件。是否有Chrome扩展程序(或其他我没有想过的)来帮助我在代码中找到正确的位置打破?

I would like to break on the 3rd party code that handles to click event. Is there a Chrome extension (or something else I haven't thought of) to help me find the right place in the code to break on?

推荐答案

您可以使用Chrome的开发人员工具;不需要扩展。

You can make use of Chrome's Developer Tools; no extension is required.

我在这里做了一个+1按钮示例: http://

I made a +1 button example here: http://jsfiddle.net/rPnAe/.

如果你去那个小提琴,然后打开开发工具(F12),然后转到脚本并展开事件监听器断点最后展开鼠标并勾选点击复选框,然后每当你点击某处(包括一个事件监听器),调试器现在将在包含侦听器函数的代码行中断。

If you go to that fiddle and then open Developer Tools (F12), then go to Scripts and expand Event Listener Breakpoints and lastly expand 'Mouse' and tick the 'click' checkbox, then whenever you click somewhere (which includes an event listener), the debugger will now break at the line of code which contains the listener function.

这篇关于如何在点击第三方按钮时设置断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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