Re: [w3c/manifest] Adding protocol handlers (#972)

@diekus commented on this pull request.



> +          The user agent MUST ask for permission when using a protocol
+          handler for the first time. This feature requires user interaction
+          and a script cannot communicate with another application on its

Hola again Marcos! Not sure which dumb questions you are referring to, they all seem important to be clear for me!

The difference between `navigator.registerProtocolHandler()` and having a `protocol_handlers` member in the manifest file is is mostly where/when is the scheme registration and invocation happening. Let me explain a bit further:

- `navigator.registerProtocolHandler()`: once it is called it will immediately try to register the scheme and show the prompt displayed above. This is handy if I want to register a scheme anytime from HTML/JS. Handy AF.
- `protocol_handlers` member in the manifest file: this will register a/several scheme(s) when a Web application is being installed. (register the installed Web app as a possible handler for that scheme). Here a noteworthy difference is that the prompt itself would appear once a user in a website on the browser invokes one of the registered schemes. For example, I installed the BatmanPWA and when I am browsing online I click on a 'web+batman://' link _and then_ the prompt appears in the browser asking if the user wants to use that (registered) PWA. This happens the first time a user invokes a specific scheme. 

So in summary, it is a matter of _where_ the registration happens, as it is more convenient for a user to decide whether they want to use an installed Web app when they run into a link that would require it instead of getting N prompts when trying to install a Wen app (where N = number of valid items in the `protocol_handlers` member in 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/w3c/manifest/pull/972#discussion_r638742800

Received on Tuesday, 25 May 2021 12:31:55 UTC