Skip to content
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

Allow cross-origin communication with remote sites #31

Closed
danielwiehl opened this issue Oct 25, 2018 · 0 comments
Closed

Allow cross-origin communication with remote sites #31

danielwiehl opened this issue Oct 25, 2018 · 0 comments

Comments

@danielwiehl
Copy link
Collaborator

The current version of workbench allows communication with remote sites via URL. The host application can change the URL or listen for URL changes. However, listening for URL changes is not allowed for a cross-origin remote site.

Instead, communication should be based on postMessage and onmessage to safely communicate cross-origin.

Also, listening for URL changes should be removed (breaking change). This is mainly because it internally uses a timer to detect URL changes as there is no change event emitted natively and MutationObserver is not applicable.

This feature will be used for the upcoming micro frontend integration to communicate with remote applications.

danielwiehl added a commit that referenced this issue Nov 15, 2018
Communication is based on 'postMessage()' and 'onmessage' to safely communicate cross-origin.

Breaking change:
Removed output property to listen for URL changes because not allowed for cross-origin communication and internally using a timer to detect URL changes (as there is no change event emitted natively and `MutationObserver` is not applicable). Use `message` output property instead.
danielwiehl added a commit that referenced this issue Nov 15, 2018
Communication is based on 'postMessage()' and 'onmessage' to safely communicate cross-origin.

Breaking change:
Removed output property to listen for URL changes because not allowed for cross-origin communication and internally using a timer to detect URL changes (as there is no change event emitted natively and `MutationObserver` is not applicable). Use `message` output property instead.
ReToCode pushed a commit that referenced this issue Nov 15, 2018
Communication is based on 'postMessage()' and 'onmessage' to safely communicate cross-origin.

Breaking change:
Removed output property to listen for URL changes because not allowed for cross-origin communication and internally using a timer to detect URL changes (as there is no change event emitted natively and `MutationObserver` is not applicable). Use `message` output property instead.
@danielwiehl danielwiehl self-assigned this Nov 16, 2018
danielwiehl added a commit that referenced this issue Dec 11, 2018
Communication is based on 'postMessage()' and 'onmessage' to safely communicate cross-origin.

Closes #31

BREAKING CHANGE:

Removed output property to listen for URL changes because not allowed for cross-origin communication and internally using a timer to detect URL changes (as there is no change event emitted natively and `MutationObserver` is not applicable). Use `message` output property instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants