-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add support for cross-origin navigation redirects #23037
Comments
This happens even when clicking a cross-origin link to load the example. That's... very bad! |
I think the Just from reading the code, which should be taken with a grain of salt, here what I think happens:
So I think we're lucky the document raises The problem here is really that we're running a page from So if And even if you just load the redirect in an existing script-thread where I even think I think the fix for this could be something like:
|
Just bumped into while moving the |
I've repurposed this bug to track the addition of the cross-origin redirects feature -- a pretty big missing piece of the web puzzle! |
This allows reusing the asynchrnous fetch mechanism that we use for page resources and is likely a step toward removing the `FetchThread`. Benefits: - Reduces IPC traffic during navigation. Now instead of bouncing between the constellation and the `ScriptThread` responses are sent directly to the `ScriptThread`. - Allows cancelling loads after redirects, which was not possible before. There is the question of what to do when a redirect is cross-origin (servo#23037). This currently isn't handled properly as the `Constellation` sends data to the same `Pipeline` that initiated the load. This change doesn't fix this issue, but does make it more possible for the `ScriptThread` to shut down the pipeline and ask the `Constellation` to replace it with a new one. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
As per #34918 (comment) I think we may be able to get some inspiration with how message ports was done, because that also involved IPC and with a kind of cross-origin "redirect" because ports are transferable inside message on ports, including across origins. Which is why the below was added, which incidentally also avoided creating a new IPC route for each port. servo/components/script/dom/globalscope.rs Line 485 in c94d909
|
This allows reusing the asynchrnous fetch mechanism that we use for page resources and is likely a step toward removing the `FetchThread`. Benefits: - Reduces IPC traffic during navigation. Now instead of bouncing between the constellation and the `ScriptThread` responses are sent directly to the `ScriptThread`. - Allows cancelling loads after redirects, which was not possible before. There is the question of what to do when a redirect is cross-origin (servo#23037). This currently isn't handled properly as the `Constellation` sends data to the same `Pipeline` that initiated the load. This change doesn't fix this issue, but does make it more possible for the `ScriptThread` to shut down the pipeline and ask the `Constellation` to replace it with a new one. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This allows reusing the asynchrnous fetch mechanism that we use for page resources and is likely a step toward removing the `FetchThread`. Benefits: - Reduces IPC traffic during navigation. Now instead of bouncing between the constellation and the `ScriptThread` responses are sent directly to the `ScriptThread`. - Allows cancelling loads after redirects, which was not possible before. There is the question of what to do when a redirect is cross-origin (#23037). This currently isn't handled properly as the `Constellation` sends data to the same `Pipeline` that initiated the load. This change doesn't fix this issue, but does make it more possible for the `ScriptThread` to shut down the pipeline and ask the `Constellation` to replace it with a new one. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
https://www.joshmatthews.net/mlredir2.html has a 301 server redirect to https://threejs.org/examples/webgl_custom_attributes_points3.html. This yields a black screen and
SecurityError: The operation is insecure.
, while loading the threejs example directly yields a functioning webgl page. I suspect the underlying problem is that we create a script thread for the initial origin, then any redirected content is still loaded in that script thread and incorrect URLs are stored in various places that are later checked.The text was updated successfully, but these errors were encountered: