diff --git a/.eslintrc.json b/.eslintrc.json index 6647d81..cb531b2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,8 +4,8 @@ "plugins": ["@typescript-eslint"], "rules": { "no-await-in-loop": "warn", - "no-unused-labels": "error", - "no-unused-vars": "error", + "no-unused-labels": "warn", + "no-unused-vars": "off", "quotes": ["error", "double"], "max-lines-per-function": [ "error", @@ -25,6 +25,6 @@ "no-unreachable": "warn", "no-undef": "off", "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/ban-ts-comment": "off" + "@typescript-eslint/ban-ts-comment": "off", } } diff --git a/src/shared/rewriters/html.ts b/src/shared/rewriters/html.ts index 2417ef2..52eb70e 100644 --- a/src/shared/rewriters/html.ts +++ b/src/shared/rewriters/html.ts @@ -71,7 +71,7 @@ function traverseParsedHtml(node, origin?: URL) { let js = node.children[0].data; const htmlcomment = //g; js = js.replace(htmlcomment, ""); - node.children[0].data = rewriteJs(js, origin); + node.children[0].data = rewriteJs(js); } if (node.name === "meta" && hasAttrib(node, "http-equiv")) { if (node.attribs["http-equiv"] === "content-security-policy") { diff --git a/src/shared/rewriters/js.ts b/src/shared/rewriters/js.ts index 26a0b62..aa1eeb3 100644 --- a/src/shared/rewriters/js.ts +++ b/src/shared/rewriters/js.ts @@ -20,7 +20,7 @@ import { initSync, rewrite_js } from "../../../rewriter/out/rewriter.js"; import "../../../static/wasm.js"; initSync(new WebAssembly.Module( - Uint8Array.from(atob(WASM), c => c.charCodeAt(0)) + Uint8Array.from(atob(self.WASM), c => c.charCodeAt(0)) )) export function rewriteJs(js: string) { diff --git a/src/types.d.ts b/src/types.d.ts index 3b32a78..bea4255 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -47,5 +47,6 @@ declare global { xor: Codec; }; }; + WASM: string; } }