Chrome DevTools搜索网站上的所有javascript文件 [英] Chrome DevTools search all javascript files in website

查看:308
本文介绍了Chrome DevTools搜索网站上的所有javascript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个新的客户端网站,从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:


  1. 打开DevTools(F12)

  2. / li>
  3. 通过按 ctrl + shift + f (Win)或 cmd + option + f (Mac)

  4. 搜索 getCurrentPosition

  5. 放置一个断点(点击行号该行的左边)

  1. Open DevTools (F12)
  2. Go to sources tab
  3. Open Search All Files by pressing ctrl + shift + f (Win) or cmd + option + f (Mac)
  4. Search getCurrentPosition
  5. Put a breakpoint (By clicking the line number at the left of the line)

这篇关于Chrome DevTools搜索网站上的所有javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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