diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41244a9..f49d0a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,7 +49,7 @@ jobs: - name: upload pages artifact uses: actions/upload-pages-artifact@v3 with: - path: './staticbuild' + path: "./staticbuild" - name: deploy to github id: deployment uses: actions/deploy-pages@v4 diff --git a/src/client/dom/storage.ts b/src/client/dom/storage.ts index d5aa220..af4bce7 100644 --- a/src/client/dom/storage.ts +++ b/src/client/dom/storage.ts @@ -63,7 +63,9 @@ export default function (client: ScramjetClient, self: typeof window) { ownKeys(target) { return Reflect.ownKeys(target) .filter((f) => typeof f === "string" && f.startsWith(client.url.host)) - .map((f) => typeof f === "string" ? f.substring(client.url.host.length + 1) : f); + .map((f) => + typeof f === "string" ? f.substring(client.url.host.length + 1) : f + ); }, getOwnPropertyDescriptor(target, property) { diff --git a/src/client/global.ts b/src/client/global.ts index f015c82..e0a9853 100644 --- a/src/client/global.ts +++ b/src/client/global.ts @@ -22,14 +22,13 @@ export function createGlobalProxy( return new Proxy(self, { get(target, prop) { if (prop === "location") return client.locationProxy; - if (typeof prop === "string" && UNSAFE_GLOBALS.includes(prop)) return client.wrapfn(self[prop]); + if (typeof prop === "string" && UNSAFE_GLOBALS.includes(prop)) + return client.wrapfn(self[prop]); if (prop === "$scramjet") return; if (prop === "eval") return indirectEval.bind(client); const value = Reflect.get(target, prop); - if (typeof prop === "string" && UNSAFE_GLOBALS.includes(prop)) - return client.wrapfn(value); - + return value; }, diff --git a/src/client/shared/wrap.ts b/src/client/shared/wrap.ts index 596ffd0..fbed974 100644 --- a/src/client/shared/wrap.ts +++ b/src/client/shared/wrap.ts @@ -47,9 +47,6 @@ export function createWrapFn(client: ScramjetClient, self: typeof globalThis) { } else if (isworker && identifier instanceof self.WorkerGlobalScope) { return client.globalProxy; } - if (identifier == self.eval) { - return indirectEval.bind(client); - } return identifier; }; diff --git a/src/shared/rewriters/html.ts b/src/shared/rewriters/html.ts index 03cb91f..8b619be 100644 --- a/src/shared/rewriters/html.ts +++ b/src/shared/rewriters/html.ts @@ -138,8 +138,8 @@ export const htmlRules: { // because they can't be fetch'd return unrewriteBlob(value); } - -return rewriteUrl(value, meta); + + return rewriteUrl(value, meta); }, src: ["video", "audio"], }, diff --git a/src/shared/rewriters/url.ts b/src/shared/rewriters/url.ts index 25bea41..50ca14a 100644 --- a/src/shared/rewriters/url.ts +++ b/src/shared/rewriters/url.ts @@ -15,14 +15,14 @@ function tryCanParseURL(url: string, origin?: string | URL): URL | null { export function rewriteBlob(url: string, meta: URLMeta) { const blob = new URL(url.substring("blob:".length)); - -return "blob:" + meta.origin.origin + blob.pathname; + + return "blob:" + meta.origin.origin + blob.pathname; } export function unrewriteBlob(url: string) { const blob = new URL(url.substring("blob:".length)); - -return "blob:" + location.origin + blob.pathname; + + return "blob:" + location.origin + blob.pathname; } export function rewriteUrl(url: string | URL, meta: URLMeta) {