Send message from a service worker

Communication between service workers and the clients browser window can be achieved by simply doing: self.clients.matchAll().then((clients) => { clients.forEach((client) => client.postMessage({ msg: "Hello from SW" })) }) The variable self is a reserved keyword in a service worker context. It references the global scope of the current worker execution scope and has some useful properties. It is like the window object of a JavaScript browser context. In the above snippet, all the clients that run the service worker are loaded, then the .postMessage is called to send message directly to the original javascript runtime of the service worker. ...

January 22, 2023 · 3 min · Aleem Isiaka

Migrating from WordPress to Gatsby - The Journey

Yes, this topic is worth a post and I will walk you through why the migration was inevitable, and how I had done it. Formerly, this website used to run on WordPress, the great PHP CMS. The design was made with the aid of Typography theme, I loved it! All of the post prior to this date was written using the WordPress admin dashboard. I loved the Gutenberg Editor, it was so fluid and easy to work with. Overall my experience was great. ...

December 15, 2019 · 8 min · Aleem Isiaka