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

后端 未结 11 1991

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:35

    Try this, if you want to log to the active page's console:

    chrome.tabs.executeScript({
        code: 'console.log("affffd")'
    });
    

提交回复
热议问题