Skip to content

Commit 1ecb23d

Browse files
committedApr 17, 2018
tweak: only register sw on https
1 parent 611237c commit 1ecb23d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

Diff for: ‎lib/app/clientEntry.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ router.onReady(() => {
3434
app.$mount('#app')
3535

3636
// Register service worker
37-
if (process.env.NODE_ENV === 'production' && SW_ENABLED) {
37+
if (process.env.NODE_ENV === 'production' &&
38+
SW_ENABLED &&
39+
window.location.protocol === 'https:') {
3840
register(`${BASE_URL}service-worker.js`, {
3941
ready () {
4042
console.log('[vuepress:sw] Service worker is active.')

0 commit comments

Comments
 (0)