Who else is missing dark mode for Service Worker page?

135 views
Skip to first unread message

Juraj M.

unread,
Sep 2, 2025, 3:51:42 AM (3 days ago) Sep 2
to Chromium Extensions

I've been working with service workers for a past few weeks and this page is killing me.
Is there maybe some workaround I could use to invert the page?

kg_17

unread,
Sep 2, 2025, 10:24:05 AM (2 days ago) Sep 2
to Chromium Extensions, Juraj M.
In chrome://flags, enable 'Auto Dark Mode for Web Contents'.

Juraj M.

unread,
Sep 2, 2025, 11:10:49 AM (2 days ago) Sep 2
to Chromium Extensions, kg_17, Juraj M.
Thank you for the tip!
It works great for that specific page, but all other normal pages looks terrible, it activates even on my extension page.
Any chance I can enable only for the specific page? I can't find any control panel.

kg_17

unread,
Sep 2, 2025, 12:09:39 PM (2 days ago) Sep 2
to Chromium Extensions, Juraj M., kg_17
It's not quite ideal, but an extension service worker can also be viewed by opening DevTools in an extension page (under Application) or a web service worker by opening DevTools on a web page.  The DevTools will be dark if dark mode is enabled in chrome://settings/appearance. 

woxxom

unread,
Sep 3, 2025, 3:07:58 AM (yesterday) Sep 3
to Chromium Extensions, kg_17, Juraj M.
Instead of using that page, open Devtools on any of your extension's pages or on chrome-extension://id/manifest.json -> Application -> Service worker -> use the buttons to start/stop the service worker.

Juraj M.

unread,
Sep 3, 2025, 3:22:48 AM (yesterday) Sep 3
to Chromium Extensions, woxxom, kg_17, Juraj M.
Well, I have a bit of a special case now...
I'm converting my extension into web app, so I need to open Service worker of the web app, not extension.
Specifically, I want to see the Service worker console, so I'm looking for the "Inspect" button, but I don't see it in the "Application" tab.
I can see it only on the chrome://serviceworker-internals/ page.

Look, it even shows me there are two errors in the "background.loader.js", but clicking it only focuses current window console, instead of opening the worker console. Maybe I should actually report this as a bug, right?

Screenshot 2025-09-03 091836.png

woxxom

unread,
Sep 3, 2025, 7:16:39 AM (yesterday) Sep 3
to Chromium Extensions, Juraj M., woxxom, kg_17
In that case you need two devtools instances: one for the web app and another one for an extension page or its chrome-extension://id/manifest.json if the extension doesn't have any pages.

woxxom

unread,
Sep 3, 2025, 7:20:05 AM (yesterday) Sep 3
to Chromium Extensions, woxxom, Juraj M., kg_17
Scratch that, I think I know what happens. Chrome combines devtools for the web app and its service worker by design, so you don't need another console, you can see the output right in this devtools. You can also debug the service worker's scripts in this devtools. The console combines the output of the page and the service worker so if you want to see only the SW's output, tick "[x] Selected context only" in the console's config.

Juraj M.

unread,
4:40 AM (16 hours ago) 4:40 AM
to Chromium Extensions, woxxom, Juraj M., kg_17
Oh, you are correct, the console output is indeed merged.
That explains why is my app logging so much...
I definitely prefer seeing "background script" logs in a separate window.

I think I need to read the MDN again because I'm getting stuck with strange issues whole day. Or is that a normal phenomenon for working with Service workers? :)
Reply all
Reply to author
Forward
0 new messages