Skip to content

allow objects in json postMessage data#481

Merged
rbri merged 1 commit intoHtmlUnit:masterfrom
twendelmuth:postMessage_allowObjects
Apr 28, 2022
Merged

allow objects in json postMessage data#481
rbri merged 1 commit intoHtmlUnit:masterfrom
twendelmuth:postMessage_allowObjects

Conversation

@twendelmuth
Copy link
Contributor

Issue
Right now if you're running postMessage({myProperty: 1}, '*'); the payload of the postMessage will actually be [object Object] (a String with this value).

What I did
I extracted the postMessage tests to another class since "Window2Test" already had enough tests and already counted up (Windows3Test also exists :))
Changing the payload in the Window.postMessage method actually did the trick.
I'm not 100% sure if Object is correct or if this needs to be specified down to something else though :-)

Potential improvements
I think we could rewrite the postMessage tests in general a bit ... didn't have time for that yet :-)

@rbri
Copy link
Member

rbri commented Apr 27, 2022

Great will have a look

@rbri rbri merged commit ef26992 into HtmlUnit:master Apr 28, 2022
@rbri
Copy link
Member

rbri commented Apr 28, 2022

Looks good, many thanks.

@twendelmuth twendelmuth deleted the postMessage_allowObjects branch April 28, 2022 09:21
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.

2 participants