Sign in

Maybe it’s because I’m a noobie programmer looking in the wrong places, but it was just so hard for me to find an easy example that uses service workers with postMessage so that I could learn how to use them in my own project. I needed postMessage because I wanted to use the background sync feature of service workers and then re-render my DOM (in this case just the html) when my service workers finished background syncing. However, service workers cannot directly communicate with the DOM so we need to use something like postMessage to talk to the client side…

Theshagod

Learning coding.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store