How to search all loaded scripts in Chrome Develop

2019-01-08 02:54发布

问题:

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:

回答1:

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:



回答2:

Search All Files with Control+Shift+F or Console->[Search tab]

NOTE: Global Search shows up next to the CONSOLE menu



回答3:

In addition to Ctrl+Shift+F (Cmd+Option+F on Mac) as suggested in this answer, you can right click on the top tree node in the sources tab and select "Search in All Files":



回答4:

In Windows Control+Shift+F. Also make sure to search in content scripts as well. Go to Settings->Sources-> Search in anonymous and content script.



回答5:

In the latest Chrome as of 10/26/2018, the top-rated answer no longer works, here's how it's done:



回答6:

In Widows it is working for me. Control Shift F and then it opens a search window at the bottom. Make sure you expand the bottom area to see the new search window.