ChatGPT解决这个技术问题 Extra ChatGPT

How to search all loaded scripts in Chrome Developer Tools?

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.

https://i.stack.imgur.com/KbOGD.png

https://i.stack.imgur.com/7hyWC.png

BTW, if you are using Source Maps (e.g. with GWT Super Dev Mode), you can search the mapped .java files by name... Type Ctrl + O (command + O on mac) in the Sources tab.
May I suggest changing the accepted answer to vsevik's? It's much more likely to be useful for today's readers.
Glad! Got Perfect answer for this question but search in network response is not available just like in Firebug, now not even in firefox
Use 'Go to file' in Google Dev Tools (a flexible and useful tool with ability search on your function name, class name in CSS,...). How to use Go to file in Google Chrome DevTools

E
Eaten by a Grue

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.

https://i.stack.imgur.com/j73zE.png

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:

https://i.stack.imgur.com/EshHP.png


Control+Shift+F is quite useful but doesn't return all hits, especially scripts inside iframe.
If Control+Shift+F is the way to go, then the upper search box is utterly misleading. Secondly, the search and hunt UI work flow is horrible. How much can you really fit in that tiny area? Why not do it like FF does?
Works well, but it take much longer than in FF. Chrome Dev Tools need many improvements yet... =(
Be sure that Developer Tools is in it's own window, if DT is docked to the main window, the command Ctrl + Shift + F will not pull up a search for sources, it will instead run a default search.
The fact that I had to google for this is telling much about UX of Chrome Dev Tools.
r
rogerdpack

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

https://i.stack.imgur.com/e7EHd.png

NOTE: Global Search shows up next to the CONSOLE menu


This answer is essentially the same as the top-voted one, which I've updated to include Console -> Search.
C
Community

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":

https://i.stack.imgur.com/f6IjR.png


Doesn't exist anymore? I don't see it on Windows.
No longer exists as of Chrome 58.
Exists again in current version
I don't see it in Chrome version 79 on mac os.
J
JDev

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.


R
RomanKousta

https://i.stack.imgur.com/WmhvN.png

https://i.stack.imgur.com/aJac0.png


Top rated answer still works if you check "Search in anonymous and content scripts" from the settings. BTW your answer is not related with what is being asked; this is for searching file names only, not the content.
R
Rupesh Kumar Tiwari

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.

https://i.stack.imgur.com/3C2cO.png


I
Iceberg

Your text may be located in the networking response.There is also a search tool in the Network tab, and you may try it.

What you want to search for may stay either in DOM or in memory. If it is not in DOM, well, it may be in memory, because you have just see it in your computer screen anyway. The text you search for may be loaded either from scripts in the initial DOM or from response in the later request.


Yes, this is it. I was analysing a Vue website and the data I was looking for was being dynamically loaded.