This recipe shows how to communicate between the service worker and a page and shows how to use a service worker to relay messages between pages.
Beginner
The postMessage
API is brilliant for passing messages between windows and iframe
s, and now we can use the service worker's message
event to act as a messenger.
- postMessage API
- Service worker registration
General Usage