Extension's indexedDb database not showing in service worker Chrome DevTools UI

359 views
Skip to first unread message

Scott Salisbury

unread,
Jun 1, 2024, 9:57:59 AM6/1/24
to Chromium Extensions
Hi,

Sorry about yet another request. Fwiw I've done as best I can to search for any relevant documentation, and this time I've done more experimentation.

My extension's service worker creates an IndexedDB database. I've confirmed that it does so and is able to store/retrieve messages in an object store of that db. 

I've also used the js "Snippets" feature in the background script's Chrome Dev Tools window to query the database and confirm that it is accessible to the extension's background script's CDT window. However, when I go to the "Application" tab of the extension's background script's CDT window and, per this Chrome developer documentation, right-click on "IndexedDB" and choose the "Refresh IndexedDB" option, I still can't see the database which my extension created.
Again, that database is accessible from that same CDT window via js code in a Snippet.

What's going on there?

woxxom

unread,
Jun 1, 2024, 10:10:37 AM6/1/24
to Chromium Extensions, Scott Salisbury
It's a frequent pain point. You'll have to open a normal page of your extension and inspect the storage in its devtools. Chrome's devtools for a worker doesn't show any storage by design, yet another evidence that enforcing service worker for extensions wasn't a good idea. If your extension doesn't have any pages, go to devtools -> Sources, right-click the title of your script (in the tab title or in the navigation panel on the left), then click "Open in new tab", then use devtools in that tab.

Scott Salisbury

unread,
Jun 1, 2024, 10:17:38 AM6/1/24
to Chromium Extensions, woxxom, Scott Salisbury
Whoa, that's weird.

Thank you so much for the workaround!

Reply all
Reply to author
Forward
0 new messages