mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
fixed sw/appcache paths
This commit is contained in:
parent
f584a221ee
commit
b12ea53a94
@ -3,7 +3,7 @@ if (process.BROWSER_BUILD && process.env.NODE_ENV === 'production') {
|
|||||||
window.onNuxtReady((app) => {
|
window.onNuxtReady((app) => {
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
if (navigator.serviceWorker.controller) {} else {
|
if (navigator.serviceWorker.controller) {} else {
|
||||||
navigator.serviceWorker.register('/_nuxt/tcmpsw.js', {scope: '/'}).then(function(res) {
|
navigator.serviceWorker.register('/sw.js').then(function(res) {
|
||||||
console.log('sw loaded...')
|
console.log('sw loaded...')
|
||||||
}).catch(function(err) {
|
}).catch(function(err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@ -13,7 +13,7 @@ if (process.BROWSER_BUILD && process.env.NODE_ENV === 'production') {
|
|||||||
// register appcache code
|
// register appcache code
|
||||||
var iframe = document.createElement('iframe');
|
var iframe = document.createElement('iframe');
|
||||||
iframe.style.display = "none";
|
iframe.style.display = "none";
|
||||||
iframe.src = '/_nuxt/appcache/manifest.html';
|
iframe.src = '/appcache/manifest.html';
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user