Accessing console and devtools of extension's background.js

后端 未结 7 2389
粉色の甜心
粉色の甜心 2020-11-21 04:17

I just started out with Google Chrome extensions and I can\'t seem to log to console from my background js. When an error occurs (because of a syntax error, for example), I

7条回答
  •  遇见更好的自我
    2020-11-21 04:49

    additionally

    if you want to see content_script js file ( when "background" property is not set ) in manifest.json

    "content_scripts": [{
        "matches": [""],
        "js": ["popup.js"],
      }]
    
    "browser_action": {
        "default_icon": "icon_32.png",
        "default_popup": "popup.html"
      }
    

    then right click on extension icon and click on Inspect popup and developer window opens with popup.html opened , there you see console tab.

提交回复
热议问题