Fix: [Extension] Remove inline script (for extension's Content Security Policy reason)

Fix: [Extension] Disable Service Worker
This commit is contained in:
MengYX
2021-02-08 03:02:33 +08:00
parent c6ea98333e
commit ce2642ad1f
5 changed files with 43 additions and 35 deletions

View File

@ -2,7 +2,8 @@
import {register} from 'register-service-worker'
if (process.env.NODE_ENV === 'production') {
if (process.env.NODE_ENV === 'production' && window.location.protocol === "https:") {
register(`${process.env.BASE_URL}service-worker.js`, {
ready() {
console.log('App is being served from cache by a service worker.')