Support » Plugin: Super Progressive Web Apps » Page offline

  • Hi all,

    i have problem to set the offline page.

    I have create a apposite page:

    https://www.fotografareperstupire.com/progressive-we-app/

    and i put the url in the set space of the plugin.

    The problem is that the plugin went in another page (the link is in the footer)

    What can i do?

    This page was set before but i have try to clean cookies, to change phone e other way but nothing.

    this is the service worker code and i thin is wrong:
    ‘use strict’;const cacheName=’www.fotografareperstupire.com-superpwa-2.0.2′;const startPage=’https://www.fotografareperstupire.com/fotografia-grandangolare/’;const offlinePage=’https://www.fotografareperstupire.com/fotografia-grandangolare/’;const filesToCache=[startPage,offlinePage,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/lenti-grandangolari-1-5.jpg’,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/lenti-grandangolari-1-5.jpg?is-pending-load=1′,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/lenti-grandangolari-1-5.jpg’,’https://www.fotografareperstupire.com/wp-content/uploads/2018/12/fotografia-grandangolare-1.jpg’,’https://www.fotografareperstupire.com/wp-content/uploads/2018/12/fotografia-grandangolare-1.jpg?is-pending-load=1′,’https://www.fotografareperstupire.com/wp-content/uploads/2018/12/fotografia-grandangolare-1.jpg’,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/fotografia-grandangolare-1-1.jpg’,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/fotografia-grandangolare-1-1.jpg?is-pending-load=1′,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/fotografia-grandangolare-1-1.jpg’,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/lenti-grandangolari-1-3.jpg’,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/lenti-grandangolari-1-3.jpg?is-pending-load=1′,’//www.fotografareperstupire.com/wp-content/uploads/2018/12/lenti-grandangolari-1-3.jpg’,’https://www.fotografareperstupire.com/wp-content/uploads/2018/12/social-finale.jpg’,’https://www.fotografareperstupire.com/wp-content/uploads/2019/01/simone-scalise-5.jpg’,’https://www.fotografareperstupire.com/wp-content/uploads/2019/01/simone-scalise-5.jpg’];const neverCacheUrls=[/\/wp-admin/,/\/wp-login/,/preview=true/];self.addEventListener(‘install’,function(e){console.log(‘SuperPWA service worker installation’);e.waitUntil(caches.open(cacheName).then(function(cache){console.log(‘SuperPWA service worker caching dependencies’);filesToCache.map(function(url){return cache.add(url).catch(function(reason){return console.log(‘SuperPWA: ‘+String(reason)+’ ‘+url);});});}));});self.addEventListener(‘activate’,function(e){console.log(‘SuperPWA service worker activation’);e.waitUntil(caches.keys().then(function(keyList){return Promise.all(keyList.map(function(key){if(key!==cacheName){console.log(‘SuperPWA old cache removed’,key);return caches.delete(key);}}));}));return self.clients.claim();});self.addEventListener(‘fetch’,function(e){if(!neverCacheUrls.every(checkNeverCacheList,e.request.url)){console.log(‘SuperPWA: Current request is excluded from cache.’);return;}
    if(!e.request.url.match(/^(http|https):\/\//i))
    return;if(new URL(e.request.url).origin!==location.origin)
    return;if(e.request.method!==’GET’){e.respondWith(fetch(e.request).catch(function(){return caches.match(offlinePage);}));return;}
    if(e.request.mode===’navigate’&&navigator.onLine){e.respondWith(fetch(e.request).then(function(response){return caches.open(cacheName).then(function(cache){cache.put(e.request,response.clone());return response;});}));return;}e.respondWith(caches.match(e.request).then(function(response){return response||fetch(e.request).then(function(response){return caches.open(cacheName).then(function(cache){cache.put(e.request,response.clone());return response;});});}).catch(function(){return caches.match(offlinePage);}));});function checkNeverCacheList(url){if(this.match(url)){return false;}
    return true;}

    Thanks at all for attention

    • This topic was modified 1 month, 1 week ago by  simoneeee.
    • This topic was modified 1 month, 1 week ago by  simoneeee.
    • This topic was modified 1 month, 1 week ago by  simoneeee.

    The page I need help with: [log in to see the link]

  • You must be logged in to reply to this topic.