mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-12 14:00:01 -04:00
rewrite the rewriter
This commit is contained in:
parent
73c1c8a5c8
commit
6a5ecc4efc
6 changed files with 62 additions and 128 deletions
|
@ -2,6 +2,7 @@ import { decodeUrl } from "./url";
|
|||
|
||||
// i am a cat. i like to be petted. i like to be fed. i like to be
|
||||
import {
|
||||
init,
|
||||
initSync,
|
||||
rewrite_js,
|
||||
rewrite_js_from_arraybuffer,
|
||||
|
@ -14,6 +15,10 @@ initSync(
|
|||
)
|
||||
);
|
||||
|
||||
init();
|
||||
|
||||
Error.stackTraceLimit = 50
|
||||
|
||||
global.rws = rewriteJs;
|
||||
export function rewriteJs(js: string | ArrayBuffer, origin?: URL) {
|
||||
if ("window" in globalThis) origin ??= new URL(decodeUrl(location.href));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue