mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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) => {
|
||||
if ('serviceWorker' in navigator) {
|
||||
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...')
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
@ -13,7 +13,7 @@ if (process.BROWSER_BUILD && process.env.NODE_ENV === 'production') {
|
||||
// register appcache code
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.style.display = "none";
|
||||
iframe.src = '/_nuxt/appcache/manifest.html';
|
||||
iframe.src = '/appcache/manifest.html';
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user