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

@ -46,6 +46,17 @@ export class ScramjetClient {
windowProxy: any;
locationProxy: any;
eventcallbacks: WeakMap<
any,
[
{
event: string;
originalCallback: AnyFunction;
proxiedCallback: AnyFunction;
},
]
> = new WeakMap();
constructor(public global: typeof globalThis) {
if ("document" in self) {
this.documentProxy = createDocumentProxy(this, global);