Skip to content

Conversation

@natebosch
Copy link
Member

Add a parent getter on window. Use it to post a parent message
instead of a private copy of the JS interop for the same. This had been
using @JS() locally as a workaround for a bug in dart:html, and now
that we aren't using dart:html anywhere in this code we can drop the
extra copy.

Expose the source field on MessageEvent. Use js_util to read the
properties which may be missing to get to the href for the message.
Trying to read the field through dart:html could throw, but after the
migration to @JS() style interop the difference interfaces for the
event source can be handled safely. Even though the host is no longer
reading the href key from the messages they are still sent from the
frame side for backwards compatibility with other host implementations.
See #2065

Add a `parent` getter on `window`. Use it to post a parent message
instead of a private copy of the JS interop for the same. This had been
using `@JS()` locally as a workaround for a bug in `dart:html`, and now
that we aren't using `dart:html` anywhere in this code we can drop the
extra copy.

Expose the `source` field on `MessageEvent`. Use `js_util` to read the
properties which may be missing to get to the `href` for the message.
Trying to read the field through `dart:html` could throw, but after the
migration to `@JS()` style interop the difference interfaces for the
event source can be handled safely. Even though the host is no longer
reading the href key from the messages they are still sent from the
frame side for backwards compatibility with other host implementations.
See #2065
@natebosch natebosch requested a review from jakemac53 July 19, 2023 00:48
@natebosch natebosch merged commit e76bffe into master Jul 19, 2023
@natebosch natebosch deleted the double-js-interop branch July 19, 2023 15:56
natebosch added a commit that referenced this pull request Oct 13, 2023
Originally the href was added manually to the data to work around a
`dart:html` limitation. A different workaround for the host side was
implemented in #2066, but the frame side was not changed in the same
commit to allow some cross-compatibility. Remove the final manual href
field now that no host implementations would read it.
natebosch added a commit that referenced this pull request Oct 13, 2023
Originally the href was added manually to the data to work around a
`dart:html` limitation. A different workaround for the host side was
implemented in #2066, but the frame side was not changed in the same
commit to allow some cross-compatibility. Remove the final manual href
field now that no host implementations would read it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants