Serve your page over HTTPS or use localhost
. Service workers require a Secure Context.
The value of window.isSecureContext
indicates whether [SecureContext]
features are visible or hidden. (This is true
on a file://
URL and the serviceWorker API will be visible, but it won’t work, of course.)