0

Iam working on site which is running on http://local.mydomain.com (virtual host)

And it gives me false when i check 'serviceWorker' in navigator So i cant test my service worker locally.

Also i have tried to put the url in to chrome://flags/#unsafely-treat-insecure-origin-as-secure but it didnt solve the problem.

Is there any workaround to fix this?

1
  • @T.J.Crowder but it gives me false when i tried to console.log('serviceWorker' in navigator); in the console,if im on https it gives me true if not false even if i put the url to the chrome://flags/#unsafely-treat-insecure-origin-as-secure Commented Apr 18, 2020 at 11:47

1 Answer 1

4

I believe there's none.

The SW will only work under HTTPS or at localhost.

Since the later option is left this way specifically for development, I'd advise to use it.

1
  • Thank you that makes sense, use https or else use localhost Commented Apr 18, 2020 at 11:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.