what's a PWA? simply a web app + these features:
can be anything, generally a html and css and optionally some js, inline or external push to somewhere (e.g. firebase)
a service worker is a js file that performs some tasks like caching, push notifications plus more (read below)
add a service worker (a js file with functions) as well as point to the service worker in the html

outputs : png formats
outputs : manifest.json, an additional line in html linking to manifest.json
index.htmlfollow this: link
e1mQe_MP5ew:APA91bHOII8ct9OU_VPbXBeBtkdiMa9gOWpXV5K89DPCNWlfleE_a_j9VE7rxVVielq9s-yhzJEA5MpiSfOHTOH4rIZCUUl_cjnUaYhlB2Sh5Jth2haf8BjsrkQ4giw05frpM2dbVHLKoutputs : additions to index.html
curl -X POST -H "Authorization: key=AIzaSyAkRH6MMhLRNpK8JUEc6eR-Y3vzL_aV4L0" -H "Content-Type: application/json" -d '{
"notification": {
"title": "Hello World PWA",
"body": "Hi",
},
"to": "dXayu72QAlo:APA91bGgh7Kzrol91H8cvdKCDzM9LuRSlgC8kXjxJaZ71ksoVNt7HT3Rc1pu3jn3zzxl0zXzYq82A9dM8GrWbJYdYknmOTBZgbIZLGvEfmEAf5RuPv5-NzNPFW75ADoO2l3TzAmDe8fX"
}' "https://fcm.googleapis.com/fcm/send"
a service worker is a programmable network proxy that sits in between the page (user) and the server, allowing you to control how network requests from your page are handled.
because it can do injections through 'man-in-the-middle' attacks, which is a BAD THING service workers only run over HTTPS.
the service worker becomes idle when not in use and restarts when needed. so a global state DOES NOT persist between events. to store info that persists between restarts, use IndexedDB databases.
service workers make extensive use of promises.
service workers are not blocking (designed to be fully async).
service workers can receive push messages from a server when the app is not active (when it is not open, like a proper native app) (subject to different browser implementations on differnet OSes)
service workers cannot access the DOM directly. it uses the postMessage() method to send data and a 'message' event listener to receive data.
yes things
no things