Service Worker Registration Failed

后端 未结 2 1972
时光取名叫无心
时光取名叫无心 2020-12-07 00:17

I am currently working on service worker to handle push notification in browser. Currently I am having this \"SW registration failed error\":

SW regis

2条回答
  •  情歌与酒
    2020-12-07 01:07

    Solved: First thing is service worker only works in secure mode either in https or localhost. It doesnot work in local resources like file:// or http.

    and second issue was during registration.

    navigator.serviceWorkerContainer
          .register('service-worker.js')
          .then(function(reg){
    

提交回复
热议问题