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

16,841

Solution 1

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!

Solution 2

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

Share:
16,841
Saugat Bhattarai
Author by

Saugat Bhattarai

I’m Saugat Bhattarai, a web developer and machine learning enthusiast living in Kathmandu. Currently, I am working on RealTime Vehicle Tracking and Recognition, a Computer Vision Project at Inspiring Lab Pvt. Lab.

Updated on June 07, 2022

Comments

  • Saugat Bhattarai
    Saugat Bhattarai about 2 years

    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?

  • Saugat Bhattarai
    Saugat Bhattarai almost 8 years
    Thank you very much you have solved my head ache. Can you further guide me in my project web pusher if you have time.
  • Dhruv Batheja
    Dhruv Batheja almost 8 years
    Yeah sure @SaugatBhattarai :). Keep posting whatever doubts you come across!
  • Saugat Bhattarai
    Saugat Bhattarai almost 8 years
    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.
  • Nuruddin Iminokhunov
    Nuruddin Iminokhunov almost 6 years
    Any idea why inspect shows empty logs even though service worker status is active, and running?
  • Dhruv Batheja
    Dhruv Batheja almost 6 years
    Are you sure you're console.log-ing something when your events fire? @NuruddinIminokhunov
  • jameshfisher
    jameshfisher over 4 years
    chrome://serviceworker-internals is old, and being replaced by the standard dev tools.
  • Charly
    Charly over 3 years
    Hello, in a recent Chrome version : chrome://inspect/#service-workers