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?
Service workers are specialized JavaScript assets that act as proxies between web browsers and web servers. They aim to improve reliability by providing offline access, as well as boost page performance.
Get familiar with the Service Workers panel in DevTools #Press `Control+Shift+J` (or `Command+Option+J` on Mac) to open DevTools. Click the Console tab.
A: From a page on the same origin, go to Developer Tools > Application > Service Workers. You can also use chrome://inspect/#service-workers to find all running service workers. To poke around at the internals (usually only Chromium developers should need this), visit chrome://serviceworker-internals .
A service worker is generated by default when we use the create-react-app to create a new React project. We will find the serviceWorker. js file in the src folder of the project. But the service worker is not functional out of the box; we will have to configure it.
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!
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:
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With