What is Service Worker Console? & Where is it in Chrome Browser?
Asked Answered
S

3

53

I am working on push notifications and came upon an unfamiliar term:

service worker console.

I have read and used the term console log or web console in browser, but I am not familier with the term service worker console, and I didn't find appropriate answer after googling it.

Can anyone explain what is service worker console? How to access it in Google Chrome?

Sharynshashlik answered 25/8, 2016 at 10:37 Comment(3)
Where did you see it? Can you provide a link, or copy-and-paste the context?Imputation
I have not heard of the term. But service workers are to replace the appcache, you could try to look at Developer tools -> Resources in Chrome. Also it's possible it is only available in some dev/beta build of Chrome.Toogood
Read the last paragraph of this article craig-russell.co.uk/2016/01/29/…Sharynshashlik
P
117

Go to chrome://serviceworker-internals

Choose any service worker and start it if not already started.

Click on Inspect!!

Boom! You have the console there!

Perilymph answered 25/8, 2016 at 21:35 Comment(8)
Thank you very much you have solved my head ache. Can you further guide me in my project web pusher if you have time.Sharynshashlik
Yeah sure @SaugatBhattarai :). Keep posting whatever doubts you come across!Perilymph
Do you have any idea about how to get unique identification of browser? I need to push message to unique browser. I am confused how to do it.Sharynshashlik
Any idea why inspect shows empty logs even though service worker status is active, and running?Abdu
Are you sure you're console.log-ing something when your events fire? @NuruddinIminokhunovPerilymph
chrome://serviceworker-internals is old, and being replaced by the standard dev tools.Butterfingers
Hello, in a recent Chrome version : chrome://inspect/#service-workersAppendicle
Only this answer is working always, the default log of the site doesn't seem show log of worker in all casesHazel
B
17

If a page has a service worker, then that service worker's logs show in that page's JavaScript console. You can see the source of a log line on the right-hand side of the log:

log line sources

In the console, there is a select box to select the JavaScript context. This defaults to top (which means "show everything"), but you can select a more specific context for just the service worker:

selecting alternative context

Butterfingers answered 10/11, 2019 at 9:27 Comment(1)
Thanks! This seems like a much easier approach than the accepted answer, may also be worth noting that self.console.log is needed from certain parts of the worker.Evangel
A
0

enter image description hereGo to Preference setting on chrome browserin Ubuntu use Shift + ? or F1 then uncheck Hide Network message and selected context only. Then restart your tab.

Angy answered 10/1 at 10:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.