AiursoftWeb / Kahla.App

Kahla is a cross-platform business messaging app.
https://www.kahla.app
MIT License
415 stars 85 forks source link

Service worker can't be registered. #937

Open hv0905 opened 3 years ago

hv0905 commented 3 years ago

[//]: <Don't delete any header! Please fill out the form, or your bug report will not be considered!>

Environment

How to repro

Service worker can't be registered. image

Expected situation

I expect that...

Other information

  1. This is because navigator.serviceWorker.controller is null when sw isn't registered. But supportWebPush() will return false when it's null, which blocks the sw to be registered.
  2. It's improper to check supportWebPush when registering sw, since sw provides many other functions, such as caching.