Skip to content

Commit

Permalink
fix: make wrapped postmessage spread
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Oct 18, 2024
1 parent 0af6cce commit 7f5d35c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/client/shared/postmessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7f5d35c

Please sign in to comment.