Register a service worker within a custom block

Topic Labels: Custom Extensions
1260 2
Showing results for 
Search instead for 
Did you mean: 
5 - Automation Enthusiast
5 - Automation Enthusiast


I’d like to be able to register a remotely hosted service worker within a custom block in order to activate push notifications. I tried it but I faced cross-origin errors because the iframe is on a different origin from the remote service worker. Any ideas how I could achieve this?

Thanks in advance,

2 Replies 2
7 - App Architect
7 - App Architect

The going advice is to use importScripts to load cross-origin scripts from the Service Worker:

Unfortunately, this isn’t a complete answer. You’ll still need a way to host a standalone script (that is: the “bootstap” Service Worker script that you register via navigator.serviceWorker.register) in a Block installation, and that’s not currently possible.

The good news is that Custom Blocks is still in beta, so the folks at Airtable are especially receptive to feature requests like this.

Thanks for the response @Mike_Pennisi. Hopefully its something that could be implemented soon :slightly_smiling_face: