Contact emails
jfern...@igalia.com
Specification
https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
Summary
The proposed `setRPHRegistrationMode` WebDriver extension command
places the user agent in a mode where it will automatically accept
or reject (depending on the mode) future Custom Protocol Handlers
registrations. This allows full end-to-end testing of Custom
Handlers API (eg, registerProtocolHandler), which normally requires
user interaction to confirm the user's consent to the protocol
registration.
I'm planning to implement and ship this testing feature, if there
are no objections.
There is an WIP PR that is still under consideration, and pending of
positive signals, or lack of objections, from implementors.
See
https://github.com/whatwg/html/pull/8267 for more details.
Motivation
The HTML spec states in the Custom Handler section that user agents
may launch a prompt dialog during the registration of a custom
protocol handler:
A user agent could, for instance, prompt the user and offer the user
the opportunity to add the site to a shortlist of handlers, or make
the handlers their default, or cancel the request. User agents could
also silently collect the information, providing it only when
relevant to the user.
Currently, there are only manual tests for the
registerProtocolHandler method:
https://github.com/web-platform-tests/wpt/blob/master/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol-handler-fragment-nosw-manual.https.html
The main problem is that Chrome, and also Firefox, launch a prompt
dialog to ask the user for confirmation to register the protocol
handler.
We could provide testing automation if we had a WebDriver extension
command that would autogrant or autoreject the registration request.
Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=1359103
Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5153153574502400