New extension command to handle Custom Handler prompt dialogs
Categories
(Remote Protocol :: Marionette, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: jfernandez, Unassigned)
References
()
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Steps to reproduce:
This is a new feature request to improve testing automation of the Custom Handler logic
Actual results:
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:
https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
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:
The main problem is that Chrome, and also Firefox, launch a prompt dialog to ask the user for confirmation to register the protocol handler.
Expected results:
We could provide testing automation if we had a WebDriver extension command that would autogrant or autoreject the registration request.
Comment 1•3 years ago
|
||
Would you mind telling us the bug that covers the implementation in Firefox? Maybe there is a Firefox preference that could be used to automatically handle or ignore these dialogs.
Comment 2•3 years ago
|
||
I assume this is related to https://github.com/w3c/webdriver/issues/1677
| Reporter | ||
Comment 3•3 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #2)
I assume this is related to https://github.com/w3c/webdriver/issues/1677
Yes, it is.
| Reporter | ||
Comment 4•3 years ago
|
||
Just in case it helps, this is the branch I'm working on to transform the registerProtocolHandler WPT, currently manual, into automated tests.
I guess I'd need to file a new RFC proposal for before I could create a PR from this branch, but I'd like to get some feedback before in the html spec related issue https://github.com/whatwg/html/issues/8251
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Hi Peter,
As mentioned in the summary, there's no way to write automated tests using webdriver for registerProtocolHandler() , so the only webplatform tests we have for this feature are manual tests. Do you think we should prioritize adding support for this in webdriver or are manual tests enough here?
| Reporter | ||
Comment 6•3 years ago
|
||
Just adding some info that may be useful to define the context of this bug. Back in Mar I detected that all these manual tests were failing in both, Chrome [1] and Firefox. It seems some changes in the URL parsing logic to add the 'fragment percent-encode set' [2] caused regression on these manual tests. Obviously, since they were manually nobody noticed it.
I've submitted a PR [3] to perform a rebaseline of these test, and although it was enough for Chrome, they are still failing in Firefox. There are more details on the HTML spec issue [4] I filed to discuss this lack of interoperability. It was mentioned that Firefox is tracking some related issues in bug #1056860.
[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1304190
[2] https://url.spec.whatwg.org/#fragment-percent-encode-set
[3] https://github.com/web-platform-tests/wpt/pull/33130
[4] https://github.com/whatwg/html/issues/7703
Comment 7•3 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #5)
As mentioned in the summary, there's no way to write automated tests using webdriver for
registerProtocolHandler(), so the only webplatform tests we have for this feature are manual tests. Do you think we should prioritize adding support for this in webdriver or are manual tests enough here?
Not sure what you mean with "prioritize". Automated tests seem better in general, I don't know what the best way would be to enable them. If additional support in webdriver is needed then that seems ok.
Comment 8•3 years ago
|
||
I don't know what the best way would be to enable them. If additional support in webdriver is needed then that seems ok.
I will set it as P3 for now. Note that we won't be able to implement that purely from Marionette, and will most likely need to have support to add entry points in the implementation of the feature itself. This also depends on how we decide to expose it to automation in https://github.com/w3c/webdriver/issues/1677 .
| Reporter | ||
Comment 9•3 years ago
|
||
Note that we won't be able to implement that purely from Marionette
FWIW, this is the initial implementation [1] I did for Chromedriver; it's still a quick prototype and it still need to pass through the forma review process, of course.
Perhaps it'd be also interesting to look at the PR I've submitted for the Web Platform Tests scripts
Finally, we are about to merge a PR [3] for the HTML spec to define a new extension command in the Custom Handlers section, so that we are able to set the UA under a state where all the permission requests are auto-granted or auto-denied. If anybody has any concern or feedback, this would be a good moment to get it.
[1] https://chromium-review.googlesource.com/c/chromium/src/+/3865270
[2] https://github.com/web-platform-tests/wpt/pull/35792
[3] https://github.com/web-platform-tests/wpt/pull/35792
| Reporter | ||
Comment 10•3 years ago
|
||
The PR [1] to change the HTML spec has been merged already with the support of Chrome and Firefox, defining a new WebDriver extension command for testing automation with protocol handlers.
I'll start implementing the change for ChromeDriver then.
Updated•3 years ago
|
Description
•