Skip to content

Add support for dart2wasm+Safari #2486

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

eyebrowsoffire
Copy link
Contributor

This PR attempts to enable dart2wasm testing with Safari. For whatever reason, in Safari, the message.source.location?.href check on the message that sends the port from the iframe to the host window actually returns the parent frame rather than the iframe's href, and only when dart2wasm is used. This changes the logic to explicitly add this value to the message being sent to avoid this problem.

This fixes #2482

Copy link

PR Health

Changelog Entry
Package Changed Files
package:test pkgs/test/lib/dart.js
pkgs/test/lib/src/runner/browser/post_message_channel.dart
pkgs/test/lib/src/runner/browser/static/host.dart.js
package:test_api pkgs/test_api/lib/src/backend/runtime.dart

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

Comment on lines +19 to +22
dom.window.parent.postMessage(
{'messageType': 'port', 'href': dom.window.location.href},
dom.window.location.origin,
[channel.port2]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not backwards compatible. A compatible host.dart needs to be rolled out everywhere before we can land this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose maybe I could post two messages, one that is just the 'port' string and the other that's the new structured message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that won't work because we're transferring the port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests run with Safari and dart2wasm stall on load
2 participants