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

Fix postMessage on the host #223

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from

Conversation

majkelcc
Copy link

Currently xdomain modifies the original data array in the postMessage handler, which breaks other scripts on the host that send arrays using postMessage.

majkelcc added 2 commits May 13, 2022 17:28
Currently xdomain modifies the original data array in the postMessage handler, which breaks other scripts on the host that send arrays through postMessage.
In some cases the browser won't allow cloning the FormData object using slice method. To avoid potential errors like this, we revert the change allowing xdomain to work on the original FormData object, but only after checking that the message originated from xdomain library.
@majkelcc
Copy link
Author

After discovering that attempting to clone FormData object can result in error in some cases, I changed the fix so that it doesn't use new methods and only allows xdomain to modify the data after checking that the message originated from the library.

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.

1 participant