Accessing console and devtools of extension's background.js

You're looking at the wrong place. Logged console messages do not appear in the web page, but in the (invisible) background page. To see these messages in the console, follow these steps:

Visit chrome://extensions/.
You can also right-click the extension icon, then click "Manage extensions".

  1. Enable developer mode
  2. Click on the link of your background page (at "Inspect views").
  3. The developer console opens for this page.

New UI:

enter image description here enter image description here

Old UI:

image


I had the same problem, in my case the logging was set to "Hide all" in the console tab in Chrome Developer tools. I had not even realised this was an option, and I can't remember turning it off

screenshot of setting in console tab in chrome dev tools


For followers who wish to see the debug console for a "content script" of their chrome extension, it is available by doing a normal "show developer console" then use the dropdown arrow to selects its "javascript environment" then you'll have access to its methods, etc.

enter image description here