mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-17 08:00:02 -04:00
fix: make wrapped postmessage spread
This commit is contained in:
parent
0af6cceec6
commit
7f5d35cc80
1 changed files with 1 additions and 6 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue