Google Chrome Javascript Debugger and Content Scripts

后端 未结 4 542
南旧
南旧 2020-11-30 03:27

This question has been asked similarly before, but I can\'t seem to debug Javascript in Google Chrome.

If I go to Page > Developer the \"Debug Javascript\" (Ctr

4条回答
  •  孤城傲影
    2020-11-30 04:22

    What you have to do is enable your extension, then in Chrome click "Developer" -> "Javascript Console". Then click the "Scripts" tab. After that you should see a listing just below of all the loaded scripts. You will see scripts for the current page as well as all the scripts for any extensions you have installed. (If you don't see any scripts listed after opening the console, you may have to refresh)

    It seems that all Chrome extensions get assigned a unique ID. You can find out your ID by viewing the Chrome Extensions page in Developer Mode.

    Then it's just a matter of searching through the scripts in the dropdown for your script. Select your script and you can set breakpoints etc.

    There's a lot more info on the Chrome Dev Tools here: http://www.chromium.org/devtools

提交回复
热议问题