查看/记录浏览器正在执行哪个 javascript 函数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7007920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
See/Log which javascript function is being executed by the browser
提问by Don Ch
Is there a way/add-on that I can use so everytime anyjavascript function is executed in Firefox for example, the function name will be printed (to the console or where ever).
有没有我可以使用的方法/附加组件,例如,每次在 Firefox 中执行任何javascript 函数时,都会打印函数名称(到控制台或任何地方)。
This is because I can't find (it's very hard to find) which function is executed when I click on a drop down.
这是因为我无法找到(很难找到)单击下拉菜单时执行的函数。
So i want firefox/add-on to tell me the name of every javascript function that is being executed.
所以我想让 firefox/add-on 告诉我正在执行的每个 javascript 函数的名称。
回答by Nivas
You can use the profiler of Firebug.
您可以使用Firebug的探查器。
Go to the console tab and click Profile. The profiler starts and all the javascript actions are "logged" till you click Profileagain. Then you get the list of javascript functions that were executed in this interval.
转到控制台选项卡并单击Profile。探查开始,所有的JavaScript动作是“记录”,直到你点击个人资料一次。然后您将获得在此时间间隔内执行的 javascript 函数列表。
A similar feature is available in most modern browsers' consoles.
大多数现代浏览器的控制台都提供类似的功能。
回答by Andrew
If you run chrome, hit f12 to bring up the developer window. Under the Profiles you can list out the Javascript, CSS or Heap. That's built in, so you don't need a plugin, not that anything is wrong with firebug, I'm just generally anti-Firefox
如果您运行 chrome,请按 f12 调出开发人员窗口。在 Profiles 下,您可以列出 Javascript、CSS 或 Heap。这是内置的,所以你不需要插件,萤火虫没有任何问题,我只是一般反 Firefox