# Progressive Web App's?

**URL:** <https://forums.realmacsoftware.com/t/progressive-web-apps/20384>\
**Category:** RapidWeaver Classic\
**Created:** [May 27, 2018, 4:47am UTC](https://forums.realmacsoftware.com/t/progressive-web-apps/20384 "2018-05-27T04:47:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Redefine](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@Redefine](https://forums.realmacsoftware.com/u/Redefine)\
**Post date:** [May 27, 2018, 4:47am UTC](https://forums.realmacsoftware.com/t/progressive-web-apps/20384/1 "2018-05-27T04:47:24Z")

</div>

Has anyone tried to convert a Rapid Weaver Website to a Progressive Web App (PWA). It looks like a process where a Manifest and a Service Worker are created and included into the html code and.  
I have made the website a Responsive Website in Rapid Weaver, however, according to the online discussions, one can create a PWA from your HTTPS website that will work like a Offline Mobile App (not Native) and it would ask the person if they would like to add the website to their Home-Screen through a Notification. It can also send Notifications to the person.  
All the different sizes of Icons are also included in the html.

Any ideas? I have created the Manifest and the Service Worker.

//This is the “Offline page” service worker

//Add this below content to your HTML page, or add the js file to your page at the very top to register service worker  
if (navigator.serviceWorker.controller) {  
console.log(’[PWA Builder] active service worker found, no need to register’)  
} else {  
//Register the ServiceWorker  
navigator.serviceWorker.register(‘pwabuider-sw.js’, {  
scope: ‘./’  
}).then(function(reg) {  
console.log(‘Service worker has been registered for scope:’+ reg.scope);  
});  
}

//This is the “Offline page” service worker

//Install stage sets up the offline page in the cache and opens a new cache  
self.addEventListener(‘install’, function(event) {  
var offlinePage = new Request(‘offline.html’);  
event.waitUntil(  
fetch(offlinePage).then(function(response) {  
return caches.open(‘pwabuilder-offline’).then(function(cache) {  
console.log(’[PWA Builder] Cached offline page during Install’+ response.url);  
return cache.put(offlinePage, response);  
});  
}));  
});

//If any fetch fails, it will show the offline page.  
//Maybe this should be limited to HTML documents?  
self.addEventListener(‘fetch’, function(event) {  
event.respondWith(  
fetch(event.request).catch(function(error) {  
console.error( '[PWA Builder] Network request Failed. Serving offline page ’ + error );  
return caches.open(‘pwabuilder-offline’).then(function(cache) {  
return cache.match(‘offline.html’);  
});  
}));  
});

//This is a event that can be fired from your page to tell the SW to update the offline page  
self.addEventListener(‘refreshOffline’, function(response) {  
return caches.open(‘pwabuilder-offline’).then(function(cache) {  
console.log(’[PWA Builder] Offline page updated from refreshOffline event: '+ response.url);  
return cache.put(offlinePage, response);  
});  
});

Does anyone know where this code need to be included in the Rapid Weaver Site?

Thank you,

R

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [June 26, 2018, 2:47pm UTC](https://forums.realmacsoftware.com/t/progressive-web-apps/20384/2 "2018-06-26T14:47:27Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
