-
Notifications
You must be signed in to change notification settings - Fork 222
Remove unused href field from error report #2061
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
Conversation
Originally all communication was done through `postMessage` on the `window`, but the manual checking between the `iframe.src` and the iframe's `window.location.href` could go out of sync if the code under test changed the browser location. To maintain the connection an isolated `MessageChannel` was created for each frame, and only the port for the channel was communicated across the window where the `href` would need to be checked, but it was passed from the host to the frame so the `origin` and `href` comparison was repeated on both sides. Move the channel creation to the frame and send the port in place of the old `'ready'` message. The ambiguous window level messages are now only sent one direction, and only once. Immediately remove the window level event listener for the individual frame once it has established the channel (or reported an exception while loading). Drop the `readyCompleter` and avoid subscribing to the channel local stream until the iframe is ready and has sent a `MessagePort`. Read the source from the message instead of sending the href in the body. The linked issue (dart-lang/sdk#22554) is only a problem when using `dart:html` which we no longer use. Since not all message source types have a `location.href` property, use `js_util.getProperty` which will return `null` when it is missing which may be the case if some other source posts a message to the window (which is not expected). Drop the extra `_postParentMessage` definition, it became redundant when migrating the other DOM interaction to static interop instead of `dart:html`.
|
Flutter has an old copy of this code. If we make this change, when we roll |
|
This host <-> frame communication has been copied or reimplemented in a few places. Internal google code has a separate host implementations, and I cannot land the change in flutter until the package is published to pub. I will not publish a change like this to pub until we have internal validation. To resolve the deadlock I'm going to take a try at first implementing a backwards/forwards compatible |
Originally the href was added manually to the data to work around a
dart:htmllimitation. A different workaround for the host side wasimplemented 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.