How to search all loaded scripts in Chrome Developer Tools?

后端 未结 7 1836
无人共我
无人共我 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: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:

提交回复
热议问题