refactor: delete codecs/ & self.$scramjet

This commit is contained in:
velzie 2024-10-13 10:20:19 -04:00
parent f8d33a207e
commit 337134bcdc
No known key found for this signature in database
GPG key ID: AA51AEFB0A1F3820
22 changed files with 148 additions and 206 deletions

View file

@ -1,5 +1,6 @@
// entrypoint for scramjet.client.js
import { loadCodecs } from "../scramjet";
import { SCRAMJETCLIENT } from "../symbols";
import { ScramjetClient } from "./client";
import { ScramjetServiceWorkerRuntime } from "./swruntime";
@ -19,6 +20,8 @@ export class ScramjetContextInit extends Event {
dbg.log("scrammin");
// if it already exists, that means the handlers have probably already been setup by the parent document
if (!(SCRAMJETCLIENT in <Partial<typeof self>>self)) {
loadCodecs();
const client = new ScramjetClient(self);
if (self.COOKIE) client.loadcookies(self.COOKIE);