Chrome DevTools搜索网站上的所有javascript文件 [英] Chrome DevTools search all javascript files in website
问题描述
我正在开发一个新的客户端网站,从CDN加载Javascript,因此Javascript不嵌入或嵌入网页源。 我想暂停 getCurrentPosition()
执行,以确定其中包含哪个外部JS文件。
I'm working on a new client's website that loads Javascript from a CDN so the Javascript is not embedded or inline with the webpage source. I would like to pause everytime getCurrentPosition()
is executed in order to determine which external JS file it is contained in.
我意识到我可以使用其他工具来通过JS文件的内容进行字符串搜索,但我宁愿保留Chrome的调试工具。
I realize I could use other tools to do a string search through the contents of the JS files but I would rather keep to Chrome's debugging tools.
我应该尝试创建一个手表表达式,还是有另一种方法来定义某个JS函数的何时何地被触发?
Should I be trying to create a watch expression or is there another way to pin down when and where a certain JS function is fired?
推荐答案
您可以使用Chrome DevTools搜索所有文件。找到你的功能并进行调试:
You can search in all files using Chrome DevTools. Find your function and debug it:
- 打开DevTools(F12)
- / li>
- 通过按
ctrl + shift + f
(Win)或cmd + option + f
(Mac) - 搜索 getCurrentPosition
- 放置一个断点(点击行号该行的左边)
- Open DevTools (F12)
- Go to sources tab
- Open Search All Files by pressing
ctrl + shift + f
(Win) orcmd + option + f
(Mac) - Search getCurrentPosition
- Put a breakpoint (By clicking the line number at the left of the line)
这篇关于Chrome DevTools搜索网站上的所有javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!