如何在Chrome Developer Tools中搜索所有加载的脚本? [英] How to search all loaded scripts in Chrome Developer Tools?

查看:564
本文介绍了如何在Chrome Developer Tools中搜索所有加载的脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Firebug中,您可以搜索一些文本,并将在加载到页面上的所有脚本中查找它。在调试客户端脚本时,Chrome Developer工具可以做到这一点吗?我试过了,但它似乎只在我打开的脚本中搜索,而不是在页面上的其余部分搜索。



我希望下一个截图能够提供更好的关于我要实现的内容的想法:



以下屏幕截图来自Firebug中的单个搜索:

解决方案

在开发工具中打开一个新的搜索窗格:
$ b

  • Ctrl + <在Mac上的 Shift + F Cmd + 选项 + I

  • 单击DevTools中的溢出菜单(),

  • 点击溢出菜单Conso ()并选择搜索选项



您可以搜索所有脚本并支持常规表达式和区分大小写。



单击任何匹配以在脚本面板中加载该文件/部分。 img src =https://i.stack.imgur.com/j73zE.pngalt =搜索所有文件 - 结果>



确保'Search in匿名和内容脚本在DevTools首选项( F1 )中进行检查。这将返回iframe和HTML内联脚本中的结果:




In Firebug, you can search some text and it will look for it in all scripts loaded on a page. Can the same be done in Chrome Developer tools while debugging client script? I tried it, but it seems to search only in the script I have open, and not the rest that are on the page.

I hope the next screenshots give a better idea about what I'm trying to accomplish:

The following screenshots are from a single search in Firebug:

解决方案

Open a new Search pane in Developer Tools by:

  • pressing Ctrl+Shift+F (Cmd+Option+I on mac)
  • clicking the overflow menu () in DevTools,
  • clicking the overflow menu in the Console () and choosing the Search option

You can search across all your scripts with support for regular expressions and case sensitivity.

Click any match to load that file/section in the scripts panel.

Make sure 'Search in anonymous and content scripts' is checked in the DevTools Preferences (F1). This will return results from within iframes and HTML inline scripts:

这篇关于如何在Chrome Developer Tools中搜索所有加载的脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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