-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
libservo: Notify embedder of protocol handler updates #40653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libservo: Notify embedder of protocol handler updates #40653
Conversation
08cf6fb to
f30a538
Compare
f30a538 to
595c23b
Compare
mrobinson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review! Looks good apart from a couple things:
595c23b to
c8b9512
Compare
c8b9512 to
eacf9c2
Compare
components/servo/tests/webview.rs
Outdated
| .url( | ||
| Url::parse( | ||
| "data:text/html,<!DOCTYPE html><script>\ | ||
| window.navigator.registerProtocolHandler('web+test', 'http://localhost:8000/web/test/');\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test here doesn't work, because registerProtocolHandler can only be called for the same origin. However, none of the webview tests load a URL that has an origin. They call use data:text/html.
How can I refer to local resources so that we spin up a webserver and run that?
All of this is to say, I think instead of having a unit test for this, I rather rely on the WPT tests for these: https://github.com/servo/servo/blob/main/tests/wpt/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol-handler-fragment-nosw.https.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me! Thanks for looking into this and sorry that it turned out to be a dead end.
FWIW, at some point we likely do need to support running tests from a small local server, but we don't have that built out in the unit tests yet and it seems like too much for this change.
eacf9c2 to
bd34b5a
Compare
048b759 to
bd34b5a
Compare
mrobinson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes here!
This implements step 2 of the web-facing API's. Now, the embedder receives a notification whether a webpage wants to register/unregister a protocol handler. They can't do anything with it yet, that's for a follow-up PR. But locally testing shows the following debug log: ``` pid:35180 Requesting to Register for scheme web+test with url https://web-platform.test:8443/html/webappapis/system-state-and-capabilities/the-navigator-object/%s ``` Part of servo#40615 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
bd34b5a to
f549e87
Compare
This implements step 2 of the web-facing API's.
Now, the embedder receives a notification whether
a webpage wants to register/unregister a protocol
handler. They can't do anything with it yet, that's for a follow-up PR. But locally testing shows the
following debug log:
Part of #40615