Skip to content

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

Description

@itg-assistant

Andrew Niese asked 2017-10-16 21:46:51 UTC

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions