Service Worker Registration Failed

后端 未结 2 1966
时光取名叫无心
时光取名叫无心 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){
    
    0 讨论(0)
  • 2020-12-07 01:13

    Use chrome webserver, to run the app or just a simple command in terminal(Mac) would do. python -m SimpleHTTPServer

    0 讨论(0)
提交回复
热议问题