[w3c/manifest] Bring back "serviceworker" member (#864)

The `"serviceworker"` member was removed from manifest in November 2019 (w3c/manifest#825), see discussion on w3c/manifest#800.

This was done because, the understanding was at the time, it was specced for years but nobody ever implemented it. Well it turns out that it _is_ being used, specifically by payment handlers, to install handler apps without actually ever running the HTML code for the site (installing the service worker directly from the manifest), and when we deleted the `"serviceworker"` member, we accidentally made that reliant on something that doesn't exist in a spec.

I'm a little unclear on the details here. @rsolomakhin can hopefully explain in more detail.

It looks like _Chromium_ (at least) is actively using this ([source code](https://source.chromium.org/chromium/chromium/src/+/master:components/payments/content/utility/payment_manifest_parser.cc?q=serviceworker)). (Aside: I think the reason we didn't detect this in November is because Chromium has a separate manifest parser for payment handlers than the main manifest parser; there is now a [tracking bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1079210) to fix this.)

I'm trying to find somewhere in the specs that rely on this, and I didn't find anything normative. In the [Payment Method Manifest spec](https://www.w3.org/TR/payment-method-manifest/#ingest), there is a non-normative note that references the now-deleted member:

> In the future, the plan is for there to be a user-agent-independent way to use the resulting [processed web app manifest](https://www.w3.org/TR/appmanifest/#dfn-processed-manifest), by consulting its `serviceworker` field and using that to install a web-based [payment app](https://w3c.github.io/payment-request/#dfn-payment-apps) conforming to the _Payment Handler API_ specification.

It's possible that Chromium is going out ahead of the spec here and implementing that "future plan". That makes it a bit hard to justify restoring this feature to the manifest spec (if it's not actually referenced by normative text in the Web Payments specs). @rsolomakhin is there a plan to make this behaviour normative?

The other thing is that it's a bit weird to have a "serviceworker" member, which nominally allows a service worker to be installed directly from a manifest, but which in practice is only used for payment handlers. Perhaps this gives us the impetus to actually implement this more generally, and allow service workers to be installed without having to be imperatively registered by the JavaScript on a page.

@marcoscaceres, you're also on Payments. Do you have thoughts about this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/864

Received on Friday, 8 May 2020 05:38:35 UTC