Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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

The following screenshots are from a single search in Firebug: alt textalt text

like image 443
Slavo Avatar asked Nov 10 '10 14:11

Slavo


People also ask

How do I search all scripts?

Use Ctrl+Shift+F and then type the word char. It will search in every scripts. That's just the shortcut of what you said.

How do I search all files in Chrome dev tools?

Yeah, if you want to search within content sources which are scripts used by extensions and the internal browser API, you enable it in the Settings of DevTools and then from any panel in DevTools you can type Ctrl + Shift + F or (on Mac) Options + Command + F (⌥⌘F) to search across all sources, snippets, and files.

How do I view scripts in Chrome?

View Source Using View Page Source Fire up Chrome and jump to the webpage you want to view the HTML source code. Right-click the page and click on “View Page Source,” or press Ctrl + U, to see the page's source in a new tab.

How do I search for files in Developer Tools?

You can easily access any file within a current project or web page by pressing Cmd + P ( Ctrl + P ) when Chrome DevTools is open and searching for the name.


3 Answers

Open a new Search pane in Developer Tools by:

  • pressing Ctrl+Shift+F (Cmd+Option+I on mac)
  • clicking the overflow menu () in DevTools, DevTools overflow menu
  • 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.

Search all files - results

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:

Search in anonymous and content scripts DevTools Settings Preferences

like image 173
vsevik Avatar answered Sep 28 '22 18:09

vsevik


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

enter image description here

NOTE: Global Search shows up next to the CONSOLE menu

like image 20
Asher Avatar answered Sep 28 '22 18:09

Asher


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

enter image description here

like image 30
Big McLargeHuge Avatar answered Sep 28 '22 17:09

Big McLargeHuge