admin管理员组

文章数量:1130213

I'm having trouble with searching through JS files in chrome dev-tools, in the past the search activated by Ctrl+Shift+F always found what I wanted, but recently (I'm not sure exactly which update triggered this) I'm finding the search does not catch

  • JS in inline script tags

  • JS inside iframes.

I've also found the callstack messed up when inline scripts were involved, but when I try to google for these issues, I just get the dev-tools doc pages, has anyone else noticed these issues? Was I just imagining this worked before?

I'm having trouble with searching through JS files in chrome dev-tools, in the past the search activated by Ctrl+Shift+F always found what I wanted, but recently (I'm not sure exactly which update triggered this) I'm finding the search does not catch

  • JS in inline script tags

  • JS inside iframes.

I've also found the callstack messed up when inline scripts were involved, but when I try to google for these issues, I just get the dev-tools doc pages, has anyone else noticed these issues? Was I just imagining this worked before?

Share Improve this question edited Jul 7, 2024 at 18:14 Rob Bednark 28.1k26 gold badges87 silver badges128 bronze badges asked Apr 11, 2013 at 9:00 Frances McMullinFrances McMullin 5,6862 gold badges19 silver badges19 bronze badges 8
  • 9 Be careful - the accepted answer works with CTRL+SHIFT+F and "Search in content scripts" enabled, but Chrome only counts 1 match per line, even if there are multiple matches on any given line. With minified JS you'll see this often. I had thought this was a Chrome bug until I realized it would find all instances if you click into the script in question and CTRL+F there. – JD Smith Commented Oct 10, 2014 at 18:45
  • Great point! I have found some inconsistent behaviour with chrome, especially after upgrades, between this "search in content scripts" setting and pretty printing minified scripts, sometimes things don't work perfectly =( – Frances McMullin Commented Oct 10, 2014 at 19:15
  • 2 Actually, there are times when Chrome simply will not find something. It happens to me often. For example, when I visit band-aidbrandfirstaid.com/first-aid-how-to-videos and search the source for _satellite.jwp.videos I see no results. Yet that string is present - screenshot I can't seem to find anyone else with this problem. For now I use Firefox and it finds it just fine. – JD Smith Commented Nov 7, 2014 at 18:27
  • That is curious indeed! I have tried the same search in my chrome and it worked fine (found 5 matches). Have you tried enabling the option mentioned in my answer below? – Frances McMullin Commented Nov 10, 2014 at 21:08
  • 2 The frame can also be squashed all the way to the bottom of the console window (at least it was for me). Drag it up so you can see if better. – Emery Lapinski Commented May 6, 2015 at 17:37
 |  Show 3 more comments

6 Answers 6

Reset to default 255

To search within content sources which are scripts used by extensions and the internal browser API, 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.

Even more helpful to what you may be needing is to set up a Workspace in Settings cog which you can map to a local directory of files which will be available in the Sources file browser sidebar which will also be searchable with the above shortcut.

There is an option under Settings -> Preferences -> Sources > Search in anonymous and content scripts.

I'm not sure how/when I disabled this but enabling it and restarting chrome has fixed all of my problems.

Latest version of DevTools

Click on the triple dot icon on the right of DevTool dock, and choose Search.

Or just hit: Control-Shift-F while using DevTools (Control-Shift-I).


Older version of DevTools

Activate 'Search in content scripts' option in DevTools General Settings. It will allow content scripts to be searchable.

Then in DevTools panel you can search the source files at the bottom of the panel.

For example:


If you don't have the Search tab in bottom of DevTools panel, click on the triple dot icon to open it.

I was facing same issue CTRL+SHIFT+F wasn't working anymore.

  1. Press f12 to open developer tools
  2. Click on vertical ellipsis on the right side of developer toolbar to open its options
  3. Click "More Tools"
  4. Click on "Search"

In the latest version CTRL+SHIFT+F doesn't work anymore even after enabling "Search in anonymous and content scripts".

Steps 1) You need to click on the three edits either at the top right or the bottom left of the dev tools.

2) You will see an option of search which is what you want.

3) Also the search tab is present at the bottom.So it might not be visible so you might have to drag the tab up.

In case it still doesn't work, check if this extension is installed in your chrome :

form filler: https://chrome.google.com/webstore/detail/form-filler/bnjjngeaknajbdcgpfkgnonkmififhfo?hl=en

CTRL+SHIFT+F was still not working for me but then I discovered that chrome extension "Form Filler" was overriding the "search all" in console command

To change this : go to url --> chrome://extensions/

then go to the bottom right : Keyboard shortcuts and you can change + CTRL+SHIFT+F command for form filler

then the command CTRL+SHIFT+F in chrome search console worked again

本文标签: How to search all JavaScript sources in Chrome Developer ToolsStack Overflow