mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-12 22:10:01 -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
|
||||
ctx.args[1] = "*";
|
||||
if (typeof ctx.args[1] === "string") ctx.args[1] = "*";
|
||||
if (typeof ctx.args[1] === "object") ctx.args[1].targetOrigin = "*";
|
||||
|
||||
ctx.return(
|
||||
wrappedPostMessage.call(ctx.fn, ctx.args[0], ctx.args[1], ctx.args[2])
|
||||
);
|
||||
ctx.return(wrappedPostMessage.call(ctx.fn, ...ctx.args));
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
args[0] += "&type=module";
|
||||
}
|
||||
|
||||
if (args[1].name === "name") {
|
||||
if (args[1].name) {
|
||||
args[1].name = `${client.url.origin}@${args[1].name}`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue