fixed sw/appcache paths

This commit is contained in:
rohitpal 2017-03-12 20:46:16 +05:30
parent f584a221ee
commit b12ea53a94

View File

@ -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);
}
})