mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
LibWeb: Make Window.postMessage closer to the spec
The main issues are using Structured{Serialize,Deserailize} instead of Structured{Serialize,Deserialize}WithTransfer and the temporary execution context usage for StructuredDeserialize. Allows Discord to load once again, as it uses a postMessage scheduler to render components, including the main App component. The callback checked the (previously) non-existent source attribute of the MessageEvent and returned if it was not the main window. Fixes the Twitch cookie consent banner saying "failed integrity check" for unknown reasons, but presumably related to the source and origin attributes.
This commit is contained in:
parent
464cc55b16
commit
fc42c75a0c
5 changed files with 361 additions and 13 deletions
|
@ -52,9 +52,8 @@ interface Window : EventTarget {
|
|||
boolean confirm(optional DOMString message = "");
|
||||
DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
|
||||
|
||||
undefined postMessage(any message, USVString targetOrigin);
|
||||
// FIXME: undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
|
||||
// FIXME: undefined postMessage(any message, optional WindowPostMessageOptions options = {});
|
||||
undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
|
||||
undefined postMessage(any message, optional WindowPostMessageOptions options = {});
|
||||
|
||||
// https://dom.spec.whatwg.org/#interface-window-extensions
|
||||
[Replaceable] readonly attribute (Event or undefined) event; // legacy
|
||||
|
@ -122,3 +121,7 @@ dictionary ScrollToOptions : ScrollOptions {
|
|||
unrestricted double left;
|
||||
unrestricted double top;
|
||||
};
|
||||
|
||||
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
|
||||
USVString targetOrigin = "/";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue