-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
url: conform structuredClone url serialization #47214
Conversation
Review requested:
|
I think this should be semver-major (with something in the doc/history). |
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.
isURL
isn't precise enough
@targos The documentation refers to the original issue. Do you have any recommendations?
|
137d2de
to
fd30f50
Compare
fd30f50
to
b915e02
Compare
I don't have a suggestion right now. |
We can tag URL objects as platform objects so that they can be rejected by v8::Serializer with node's SerializerDelegate. Managed to come up with a demo: https://github.com/legendecas/node/tree/platform-object-brand (note: it still fails constructor prototype idl checks, and needs more tweaking). |
A better solution can be delegating custom JS object serialization with v8's value serializer: https://chromium-review.googlesource.com/c/v8/v8/+/4385565 so that we don't have to alter the prototype chain of |
@legendecas Thank you for working on this. I really like this approach. The previous approach of tagging each prototype with |
I'm closing this pull request in favor of @legendecas's pull request. Thanks! |
Mark URL/URLSearchParams as uncloneable and untransferable to reject them in `structuredClone` and `port.postMessage`. PR-URL: #47497 Refs: #47214 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Mark URL/URLSearchParams as uncloneable and untransferable to reject them in `structuredClone` and `port.postMessage`. PR-URL: nodejs#47497 Refs: nodejs#47214 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Mark URL/URLSearchParams as uncloneable and untransferable to reject them in `structuredClone` and `port.postMessage`. PR-URL: nodejs#47497 Refs: nodejs#47214 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Enabled 2 more web platform tests for URL and URLSearchParams for disallowing them to be called in
structuredClone
. cc @nodejs/url