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
feat: add support for DOM elements going over the context bridge #26776
Conversation
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.
needs docs.
do these tests already include sending WebElements in both directions across the bridge?
c20b832
to
a5f69ec
Compare
@nornagon Docs updated, tests go both ways 👍 |
a5f69ec
to
93a55b7
Compare
docs/api/context-bridge.md
Outdated
@@ -106,6 +106,7 @@ has been included below for completeness: | |||
| `Promise` | Complex | ✅ | ✅ | Promises are only proxied if they are the return value or exact parameter. Promises nested in arrays or objects will be dropped. | | |||
| `Function` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending classes or constructors will not work. | | |||
| [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple | ✅ | ✅ | See the linked document on cloneable types | | |||
| `HTMLElement` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending custom elements will not work. | |
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.
I believe this is incorrect, as this supports Element
not just HTMLElement
. e.g. SVGElement
is a child class of Element
but not HTMLElement
.
Further—should/can we support Node
here, so we can additionally pass references to text nodes?
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.
@nornagon The "FromV8" part of this comes from WebElement
and the "ToV8" comes from WebNode
. So I think that means we can't support Node
's 🤔
Release Notes Persisted
|
As in title and as in notes, uses blink APIs to safely transfer a WebElement reference from one context to another
Notes: Added support for passing DOM elements over the context bridge