google chrome extension :: console.log() from background page?

后端 未结 11 1967

If I call console.log(\'something\'); from the popup page, or any script included off that it works fine.

However as the background page is not directly

11条回答
  •  伪装坚强ぢ
    2020-11-30 17:50

    To get a console log from a background page you need to write the following code snippet in your background page background.js -

     chrome.extension.getBackgroundPage().console.log('hello');
    

    Then load the extension and inspect its background page to see the console log.

    Go ahead!!

提交回复
热议问题