Chrome's "Add To Home Screen" and Service Workers

0
0

I wanted to enable support for Chrome’s “App Install Banners” (https://developers.google.com/web/fundamentals/app-install-banners/) and discovered the concept of progressive web apps and service workers (https://developers.google.com/web/fundamentals/primers/service-workers/)

From my understanding, when this is properly configured, it should allows certain resources/URLs to be cached on the device upon “Add to Homescreen”, which will speed up the user experience on low-bandwidth connections like 3G. More details here: https://developers.google.com/web/ilt/pwa/caching-files-with-service-worker

I think I have a (mostly) working service worker Javscript now, but this error appears in the console: Uncaught (in promise) TypeError: Request method ‘POST’ is unsupported (line 51)

(unsure if this affects the overall operation or just certain elements that are being posted)

Questions:

Are you guys familiar with service worker concepts and related javascript?
Aside from being a requirement for Chrome’s “Add to Homescreen”, is it something that would be further beneficial in conjunction with WiseJ?
Are there out-of-box examples that would work well with WiseJ?
What resources are safe to cache with this method?

So far, I have a style sheet, and wisej.wx.

var urlsToCache = [
‘/’,
‘/StyleSheets/StyleSheet.css’,
‘/wisej.wx’
];
Current JS is attached. Thanks for any insight.

Attachment
  • You must to post comments
0
0

ServiceWorkers seems to just WebWorkers registered in relation to a URL and can handle/filter network requests. You can register them using plain javascript. Wisej doesn’t stand in the way. Wisej also has a web worker extension allowing you to create and manage web workers. If you find something useful for them to do.

I don’t really know what a server-based application may do with a service worker faking a connection. But it sounds like it’s designed for client-side javascript applications.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.