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

**URL:** <https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967>\
**Category:** Developers\
**Created:** [April 6, 2022, 3:35pm UTC](https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967 "2022-04-06T15:35:58Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jesse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jesse/32/37836_2.png) [@Jesse](https://forum.dfinity.org/u/Jesse)\
**Post date:** [April 10, 2022, 12:44pm UTC](https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967/21 "2022-04-10T12:44:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [April 10, 2022, 1:16pm UTC](https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967/22 "2022-04-10T13:16:07Z")

</div>

Super happy to hear it worked out 🥳

---

<div class="post-metadata">

**Author:** ![Jesse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jesse/32/37836_2.png) [@Jesse](https://forum.dfinity.org/u/Jesse)\
**Post date:** [May 22, 2022, 11:51am UTC](https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967/23 "2022-05-22T11:51:31Z")

</div>

> [@peterparker](#):
>
> In other words: even if you don’t register a service worker there is actually already one that is registered for you

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.

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [May 22, 2022, 1:07pm UTC](https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967/24 "2022-05-22T13:07:51Z")

</div>

> [@Jesse](#):
>
> 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.

[Previous page](https://forum.dfinity.org/t/how-d-they-code-the-nns-front-end-to-do-this/11967.md?page=1)
