mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
fix: proxy postmessage properly
This commit is contained in:
parent
51ce240bf5
commit
ca79f507d7
2 changed files with 4 additions and 5 deletions
|
@ -55,11 +55,10 @@ export default function (client: ScramjetClient) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// * origin because obviously
|
// * origin because obviously
|
||||||
ctx.args[1] = "*";
|
if (typeof ctx.args[1] === "string") ctx.args[1] = "*";
|
||||||
|
if (typeof ctx.args[1] === "object") ctx.args[1].targetOrigin = "*";
|
||||||
|
|
||||||
ctx.return(
|
ctx.return(wrappedPostMessage.call(ctx.fn, ...ctx.args));
|
||||||
wrappedPostMessage.call(ctx.fn, ctx.args[0], ctx.args[1], ctx.args[2])
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||||
args[0] += "&type=module";
|
args[0] += "&type=module";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[1].name === "name") {
|
if (args[1].name) {
|
||||||
args[1].name = `${client.url.origin}@${args[1].name}`;
|
args[1].name = `${client.url.origin}@${args[1].name}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue