Jul 04, 2020 07:28 AM
Hi,
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,
Fatma.
Jul 20, 2020 03:51 PM
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.
Jul 22, 2020 01:51 AM
Thanks for the response @Mike_Pennisi. Hopefully its something that could be implemented soon :slightly_smiling_face: