From 7f5d35cc805ad544105dcf425696627ef6bb92e5 Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:14:23 -0500 Subject: [PATCH] fix: make wrapped postmessage spread --- src/client/shared/postmessage.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/client/shared/postmessage.ts b/src/client/shared/postmessage.ts index b436b0c..a9da497 100644 --- a/src/client/shared/postmessage.ts +++ b/src/client/shared/postmessage.ts @@ -41,12 +41,7 @@ export default function (client: ScramjetClient) { // this WOULD be enough but the source argument of MessageEvent has to return the caller's window // and if we just call it normally it would be coming from here, which WILL NOT BE THE CALLER'S because the accessor is from the parent // so with the stolen function we wrap postmessage so the source will truly be the caller's window (remember that function is scramjet's!!!) - const wrappedPostMessage = Function( - "data", - "origin", - "transfer", - "this(data, origin, transfer)" - ); + const wrappedPostMessage = Function("...args", "this(...args)"); ctx.args[0] = { $scramjet$messagetype: "window",