Skip to content

Fix postMessage on the host#223

Open
majkelcc wants to merge 2 commits intojpillora:gh-pagesfrom
majkelcc:post-message-fix
Open

Fix postMessage on the host#223
majkelcc wants to merge 2 commits intojpillora:gh-pagesfrom
majkelcc:post-message-fix

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