How’d they code the NNS front end to do this?

Got it working thanks to this. The issue was that I was putting the manifest.json file in the wrong directory. It should’ve been in the assets directory. I had it in the same directory as the index.html file.

1 Like

Super happy to hear it worked out :partying_face:

1 Like

Where can i see the code for this pre-built service worker? I’m attempting to code a button on my front end that allows users to add my app to their Home Screen. And to do that, i need to call the function that registers the service worker.

What code are you trying to implement? Can you share it?

Not sure if the service-worker code is open sourced yet or not. In any case, it cannot be modified at this time, it is injected in the response and voilà. There is a task to make this an opt-out option if I get it right, not sure if in progress or “just” planned.

I heard, in case you would like to implement some custom features, a potential workaround is registering a custom service worker in the /_raw/ domain. I tried out it didn’t worked for me but if I get it right it’s what’s used by OpenChat to register the notifications, so it should work out.