Chrome DevTools: Debug your Push Notifications Workflow
Last updated: 11th October 2019In JavaScript, you can use a Service Worker to send Push Notifications to your user by using the ServiceWorkerRegistration.showNotification()
API.
You would typically show the notification in response to a Push Event (e.g. self.addEventListener('push', event => {})
)
To help with development and debugging, you can use DevTools to trigger push events with custom data:
- In DevTools, open up the Application panel
- Open the Service Workers Pane
- In the Push input box, type in a message of your choice or use the prefilled text
- Click the Push button
- Observe a native (operating system) style notification appear
You can use this demo to try this feature: gauntface.github.io/simple-push-demo