How to enable console.log from Service Worker?

I found this bug:

It says that to enable the console you need to use console sub tab. But I don’t see any sub tabs or anything related to service worker. There are toggle buttons only.

There is also a bug:

How to enable console.log from Service Worker in Firefox? Why this is not enabled by default?

If this is possible I would add this to the documentation: Debugging service workers

You can either use about:debugging to have a Service Worker dedicated toolbox, or you can enable an experimental feature: go to about:preferences , search for devtools.debugger.features.windowless-service-workers and set it to true, then restart your regular Devtools toolbox.
We are currently planning to enable this by default soon.
Let us know if you’re still missing your console logs

1 Like

about:preferences opens the default UI for settings and devtools.debugger.features.windowless-service-workers return no results.

EDIT: In about:config I set devtools.debugger.features.windowless-service-workers to true still no console.log.

I would like to see console.log in the page that register the worker.

sorry, I meant about:config

Yes, I just found it and edit the comment. It makes no effect no console.log.

Is the page public? could you share the URL?
Are you seeing the logs if you use about:debugging (just to make sure that the logs are indeed emitted)

This is useless you need to inspect a new process each time the worker is activated. It’s impossible to work with. But the logs are there.

so with devtools.debugger.features.windowless-service-workers set to true, if you first go to the Debugger, then triggers the action that triggers the logs, then go to the console, do you see them?

I had the same problem, and follow @Nicolas_Chevobbe 's solution, it works.

Thank you!. your solution save my day :slight_smile: