mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-12 14:00:01 -04:00
add more flags
This commit is contained in:
parent
7adf76d37f
commit
4d1b7ef1b8
10 changed files with 85 additions and 57 deletions
|
@ -23,6 +23,11 @@ export function rewriteJs(js: string | ArrayBuffer, origin?: URL) {
|
|||
if ("window" in globalThis)
|
||||
origin = origin ?? new URL(decodeUrl(location.href));
|
||||
|
||||
if (self.$scramjet.config.flags.naiiveRewriter) {
|
||||
const text = typeof js === "string" ? js : new TextDecoder().decode(js);
|
||||
return rewriteJsNaiive(text, origin);
|
||||
}
|
||||
|
||||
const before = performance.now();
|
||||
if (typeof js === "string") {
|
||||
js = new TextDecoder().decode(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue