Re: [w3ctag/design-reviews] URL Protocol Handler Registration for PWAs (#482)

> Hey, HTML spec editor here. I don't think it's appropriate to change how navigation works without changing the HTML spec... See also [w3ctag/design-principles#184](https://github.com/w3ctag/design-principles/issues/184) and https://annevankesteren.nl/2014/02/monkey-patch.


@domenic I don’t believe we are monkey patching. Our current plan—which @diekus is referring to—is to reference [the HTML spec’s logic for normalizing/vetting protocol handlers](https://html.spec.whatwg.org/multipage/system-state.html#normalize-protocol-handler-parameters), which is analogous to how [`ImageResource` references HTML’s `sizes` parsing](https://www.w3.org/TR/image-resource/#processing-an-imageresource-from-an-api) and how the Manifest currently references [`ImageResource` processing](https://www.w3.org/TR/appmanifest/#dfn-process-image-resources) and [the Screen Orientation API](https://www.w3.org/TR/appmanifest/#orientation-member). The reason for the reference (as opposed to defining a bespoke mechanism) is that any protocols that get added to (or removed from) HTML spec will get picked up automatically.

Assuming HTML doesn’t abandon the Protocol Handler API, we don’t foresee it becoming an issue. And if it comes to pass that `registerProtocolHandler()` becomes deprecated or is otherwise removed from the spec, we’ll resolve the ReSpec issue by bringing the referenced normalization logic into the Manifest spec.

As I understand it, the plumbing of the two approaches will be largely the same as this is, essentially, a declarative means of doing what `registerProtocolHandler` currently does programmatically (@fabiorocha and @diekus can get into the specifics on that, if needed); the only difference will be routing users to the installed PWA as opposed to the browser itself. As it is an installed PWA-specific behavior, it feels like that that should be defined in the Manifest spec, as opposed to HTML. Or are you thinking that we should include the navigation resolution (PWA vs. browser) in HTML so that calls to `registerProtocolHandler`, if made from within the context of an installed PWA, could use it as well (and we would just reference that from the Manifest)?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/482#issuecomment-793269745

Received on Tuesday, 9 March 2021 02:10:26 UTC