0

I built an ASP .Net MVC web application using .Net 6 and Web Essentials AspNetCore PWA by madskristensen

Everything is normal in localhost Visual Studio or localhost IIS, but no matching service worker when accessed using IP IIS

Visual Studio Localhost: (https://i.stack.imgur.com/DtKYd.png)

IIS Localhost: (https://i.stack.imgur.com/wo4d4.png)

IIS with IP Address: (https://i.stack.imgur.com/Jlcjd.png)

I've googling so many time, but none of them are works for me

Any suggest what should i do? Thanks before

  • Service workers will only register and install on the secure origin. You may need a valid certificate, please refer to [this link](https://stackoverflow.com/a/69957305/18789859). – Chen Dec 15 '22 at 06:04
  • @Chen thanks for your answer & reference, is there another way to register Service Worker without secure origin? – user15992852 Dec 15 '22 at 08:06
  • Service workers are only available to "secure origins" (`HTTPS` sites, basically) in line with a policy to prefer secure origins for powerful new features. `http://localhost` is also considered a secure origin. Here is a solution you can try: [I get an error message about "Only secure origins are allowed". Why?](https://www.chromium.org/blink/serviceworker/service-worker-faq/). – Chen Dec 15 '22 at 09:33

0 Answers0