SetRPHRegistrationMode WebDriver extension comnand
- Category
- Miscellaneous
- Type
- No developer-visible change
- Status
- In development (Chrome In development)
- Intent stage
- Start prototyping
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.
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.
Standards & signals
- Specification: https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
- Firefox: Positive
- Safari: No signal — Safari doesn't implement the registerProtocolHandler API, but nodoty opposed to the feature.
- Web developers: No signals
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1359103
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=protocol-handler
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+SetRPHRegistrationMode%20WebDriver%20extension%20comnand
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=SetRPHRegistrationMode%20WebDriver%20extension%20comnand
- Baseline status: https://webstatus.dev/?q=SetRPHRegistrationMode%20WebDriver%20extension%20comnand