Skip to content

Commit 0449fe4

Browse files
committed
[chrome] make chrome actually function again
1 parent db75996 commit 0449fe4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "rspack build",
1212
"build:dreamland": "cd external/dreamlandjs && pnpm build",
1313
"build:chrome": "cd packages/chrome && pnpm build",
14-
"dev": "node --localstorage-file='./uwu' --no-warnings=ExperimentalWarning devserver.ts",
14+
"dev": "node --no-warnings=ExperimentalWarning devserver.ts",
1515
"watch": "rspack build --watch",
1616
"format": "prettier --write .",
1717
"preinstall": "npx only-allow pnpm"

packages/inject/src/scramjet.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,15 @@ export function loadScramjet({
2929
setWasm(Uint8Array.from(atob(self.WASM), (c) => c.charCodeAt(0)));
3030
delete (self as any).WASM;
3131

32+
if (SCRAMJETCLIENT in globalThis) {
33+
//@ts-expect-error god bless america
34+
client = globalThis[SCRAMJETCLIENT];
35+
return;
36+
}
37+
3238
const transport = new LibcurlClient({ wisp });
3339

34-
loadAndHook({
40+
client = new ScramjetClient(globalThis, {
3541
context: {
3642
interface: {
3743
getInjectScripts,
@@ -43,8 +49,10 @@ export function loadScramjet({
4349
prefix: new URL(prefix),
4450
},
4551
transport,
52+
shouldPassthroughWebsocket: (url) => {
53+
return url === "wss://anura.pro/";
54+
},
4655
sendSetCookie: async (url: URL, cookie: string) => {},
4756
});
48-
49-
client = self[SCRAMJETCLIENT];
57+
client.hook();
5058
}

0 commit comments

Comments
 (0)