提交 1ecb23d6 编写于 作者: E Evan You

tweak: only register sw on https

上级 611237ca
......@@ -34,7 +34,9 @@ router.onReady(() => {
app.$mount('#app')
// Register service worker
if (process.env.NODE_ENV === 'production' && SW_ENABLED) {
if (process.env.NODE_ENV === 'production' &&
SW_ENABLED &&
window.location.protocol === 'https:') {
register(`${BASE_URL}service-worker.js`, {
ready () {
console.log('[vuepress:sw] Service worker is active.')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册