mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
swruntime: implement fetch event
This commit is contained in:
parent
14a0305bdb
commit
15bc9598c9
9 changed files with 273 additions and 31 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue