swruntime: implement fetch event

This commit is contained in:
velzie 2024-08-02 21:57:33 -04:00
parent 14a0305bdb
commit 15bc9598c9
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
9 changed files with 273 additions and 31 deletions

View file

@ -1,6 +1,7 @@
// entrypoint for scramjet.client.js
import { ScramjetClient } from "./client";
import { ScramjetServiceWorkerRuntime } from "./swruntime";
export const iswindow = "window" in self;
export const isworker = "WorkerGlobalScope" in self;
@ -13,4 +14,9 @@ dbg.log("scrammin");
if (!(ScramjetClient.SCRAMJET in self)) {
const client = new ScramjetClient(self);
client.hook();
if (issw) {
const runtime = new ScramjetServiceWorkerRuntime(client);
runtime.hook();
}
}