Find JavaScript function definition in Chrome

前端 未结 11 2304
难免孤独
难免孤独 2020-11-28 17:16

Chrome\'s Developer Tools rock, but one thing they don\'t seem to have (that I could find) is a way to find a JavaScript function\'s definition. This would be super handy fo

11条回答
  •  野性不改
    2020-11-28 18:04

    I find the quickest way to locate a global function is simply:

    1. Select Sources tab.
    2. In the Watch pane click + and type window
    3. Your global function references are listed first, alphabetically.
    4. Right-click the function you are interested in.
    5. In the popup menu select Show function definition.
    6. The source code pane switches to that function definition.

提交回复
热议问题