Search code examples
javascriptgoogle-chrome-extensionconsolebrowser-action

No console log for external script called by chrome.tabs.executeScript


I'm using two js files to accomplish a task for a chrome extension.

In background.js, I have the following line of code that calls another js file: chrome.tabs.executeScript(tabId, {file: "src/bg/sidebar.js"});

When I run the extension, the script in sidebar.js appears to run, but the console does not display the log. The console does display all logs from the background.js. Does anyone know why this is happening?


Solution

  • As @rsanchez and @xan said, the content script logs to the console of the tab where I injected the script. I found this by viewing View -> Developer -> JavaScript Console.