Re: [manifest] Integration with service workers (#161)

> Why would you want to offer ServiceWorker features to home-screen-launched but not browser visited?

My point here was just that this could be a use case similar to the app store use case where the user may install the app before having used it, then it would be nice if the Service Worker was already registered the first time they launch the app. That wouldn't prevent the same Service Worker from being used in the browser if the user navigated to https://evernote.com/Home.action.

> If the home-screen-thing has a different storage & SW, the system can detect which origins the user has icons for and remove storage & SW without the manifest.

Not necessarily, there could be multiple apps installed from the same origin. I don't think the OS would necessarily know which Service Workers to unregister.

> How would you tell the difference between a normal SW install, and one triggered from add-to-homescreen?

That's a fair point. I guess the developer would have to specify a separate Service Worker in the manifest as an installation script, which then in turn registers other Service Workers which would also be registered in the browser.

I guess the question is really whether there's enough value in:
* Being able to specify a Service Worker in the manifest to be registered at install time before an application context is created, vs. relying on the Service Worker being registered before installation via a browsing context and surviving the transition to an application context, otherwise risk that the app might not work offline etc. the first time it is launched.
* An install event which is fired at install time.
* Whether having a Service Worker which is only registered when the app is installed, or having a different Service Worker registered when the app is installed, is a valid design choice.

As you say, a general install event could be implemented separately if considered useful, but might just re-invent Service Workers.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/161#issuecomment-70087986

Received on Thursday, 15 January 2015 13:53:42 UTC