How to search all loaded scripts in Chrome Developer Tools?

后端 未结 7 1804
无人共我
无人共我 2020-11-30 16:02

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

相关标签:
7条回答
  • 2020-11-30 16:38

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

    NOTE: Global Search shows up next to the CONSOLE menu

    0 讨论(0)
  • 2020-11-30 16:38

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

    0 讨论(0)
  • 2020-11-30 16:41

    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.

    0 讨论(0)
  • 2020-11-30 16:47

    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.

    0 讨论(0)
  • 2020-11-30 16:57

    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.

    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:

    0 讨论(0)
  • 2020-11-30 16:58

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

    0 讨论(0)
提交回复
热议问题