File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments