mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-17 08:00:02 -04:00
fix: misc bugs
This commit is contained in:
parent
58fed66f78
commit
ca3e09af8e
8 changed files with 20 additions and 28 deletions
|
@ -9,7 +9,7 @@ export default function (client: ScramjetClient, _self: typeof globalThis) {
|
|||
client.Proxy("fetch", {
|
||||
apply(ctx) {
|
||||
if (typeof ctx.args[0] === "string" || ctx.args[0] instanceof URL) {
|
||||
ctx.args[0] = rewriteUrl(ctx.args[0].toString(), client.meta);
|
||||
ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
|
||||
|
||||
if (isemulatedsw) ctx.args[0] += "?from=swruntime";
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export default function (client: ScramjetClient, _self: typeof globalThis) {
|
|||
client.Proxy("Request", {
|
||||
construct(ctx) {
|
||||
if (typeof ctx.args[0] === "string" || ctx.args[0] instanceof URL) {
|
||||
ctx.args[0] = rewriteUrl(ctx.args[0].toString(), client.meta);
|
||||
ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);
|
||||
|
||||
if (isemulatedsw) ctx.args[0] += "?from=swruntime";
|
||||
}
|
||||
|
|
|
@ -50,6 +50,10 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
binaryType: "blob",
|
||||
barews,
|
||||
|
||||
onclose: null,
|
||||
onerror: null,
|
||||
onmessage: null,
|
||||
onopen: null,
|
||||
captureListeners: {},
|
||||
listeners: {},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue