Skip to content

Commit 12ddbdc

Browse files
committed
unregister service worker
1 parent 3e07d13 commit 12ddbdc

File tree

2 files changed

+46
-37
lines changed

2 files changed

+46
-37
lines changed

_config.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -102,43 +102,43 @@ markdown:
102102
# Offline
103103
## Config passed to sw-precache
104104
## https://github.com/JLHwung/hexo-offline
105-
offline:
106-
maximumFileSizeToCacheInBytes: 10485760
107-
staticFileGlobs:
108-
- public/**/*.{js,html,css,png,jpg,jpeg,gif,svg,eot,ttf,woff,woff2,json,xml}
109-
stripPrefix: public
110-
verbose: true
111-
runtimeCaching:
112-
# Ad Sources - should be networkFirst
113-
- urlPattern: /*
114-
handler: networkFirst
115-
options:
116-
origin: sendgrid.sp1.convertro.com
117-
- urlPattern: /*
118-
handler: networkFirst
119-
options:
120-
origin: ad.doubleclick.net
121-
# CDNs - should be cacheFirst, since they should be used specific versions so should not change
122-
- urlPattern: /*
123-
handler: cacheFirst
124-
options:
125-
origin: cdn.jsdelivr.net
126-
- urlPattern: /*
127-
handler: cacheFirst
128-
options:
129-
origin: fonts.googleapis.com
130-
- urlPattern: /*
131-
handler: cacheFirst
132-
options:
133-
origin: fonts.gstatic.com
134-
- urlPattern: /*
135-
handler: cacheFirst
136-
options:
137-
origin: cdnjs.cloudflare.com
138-
- urlPattern: /*
139-
handler: cacheFirst
140-
options:
141-
origin: maxcdn.bootstrapcdn.com
105+
# offline:
106+
# maximumFileSizeToCacheInBytes: 10485760
107+
# staticFileGlobs:
108+
# - public/**/*.{js,html,css,png,jpg,jpeg,gif,svg,eot,ttf,woff,woff2,json,xml}
109+
# stripPrefix: public
110+
# verbose: true
111+
# runtimeCaching:
112+
# # Ad Sources - should be networkFirst
113+
# - urlPattern: /*
114+
# handler: networkFirst
115+
# options:
116+
# origin: sendgrid.sp1.convertro.com
117+
# - urlPattern: /*
118+
# handler: networkFirst
119+
# options:
120+
# origin: ad.doubleclick.net
121+
# # CDNs - should be cacheFirst, since they should be used specific versions so should not change
122+
# - urlPattern: /*
123+
# handler: cacheFirst
124+
# options:
125+
# origin: cdn.jsdelivr.net
126+
# - urlPattern: /*
127+
# handler: cacheFirst
128+
# options:
129+
# origin: fonts.googleapis.com
130+
# - urlPattern: /*
131+
# handler: cacheFirst
132+
# options:
133+
# origin: fonts.gstatic.com
134+
# - urlPattern: /*
135+
# handler: cacheFirst
136+
# options:
137+
# origin: cdnjs.cloudflare.com
138+
# - urlPattern: /*
139+
# handler: cacheFirst
140+
# options:
141+
# origin: maxcdn.bootstrapcdn.com
142142

143143
# Deployment
144144
## Docs: https://hexo.io/docs/one-command-deployment

themes/vue/layout/layout.ejs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@
131131
autocompleteOptions: { hint: false, appendTo: 'body'}
132132
})
133133
})
134+
135+
// unregister service worker
136+
if ('serviceWorker' in navigator) {
137+
navigator.serviceWorker.getRegistrations().then(function(registrations) {
138+
for(let registration of registrations) {
139+
registration.unregister()
140+
}
141+
})
142+
}
134143
</script>
135144
</body>
136145
</html>

0 commit comments

Comments
 (0)