diff --git a/src/client/shared/import.ts b/src/client/shared/import.ts index 6f1811e..8b23bf8 100644 --- a/src/client/shared/import.ts +++ b/src/client/shared/import.ts @@ -3,7 +3,7 @@ import { config } from "../../shared"; import { rewriteUrl } from "../../shared/rewriters/url"; export default function (client: ScramjetClient, self: Self) { - const Function = client.natives.Function; + const Function = client.natives["Function"]; self[config.globals.importfn] = function (base: string) { return function (url: string) { diff --git a/src/client/shared/requests/xmlhttprequest.ts b/src/client/shared/requests/xmlhttprequest.ts index ca6fc01..2fc0c4f 100644 --- a/src/client/shared/requests/xmlhttprequest.ts +++ b/src/client/shared/requests/xmlhttprequest.ts @@ -5,7 +5,9 @@ import { ScramjetClient } from "../../client"; export default function (client: ScramjetClient, self: Self) { let worker; if (self.Worker && flagEnabled("syncxhr", client.url)) { - worker = new client.natives["Worker"](config.files.sync); + worker = new (client.natives["Worker"] ? client.natives["Worker"] : Worker)( + config.files.sync + ); } const ARGS = Symbol("xhr original args"); const HEADERS = Symbol("xhr headers");