mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
return fake serviceworkerregistration
This commit is contained in:
parent
91dc2f96cd
commit
f2fe8c1d5e
5 changed files with 87 additions and 2 deletions
21
src/client/swruntime.ts
Normal file
21
src/client/swruntime.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { encodeUrl } from "../shared/rewriters/url";
|
||||
|
||||
class ScramjetServiceWorkerRuntime {
|
||||
constructor() {
|
||||
addEventListener("message", (event) => {
|
||||
if ("scramjet$type" in event.data) {
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
ScramjetServiceWorkerRuntime: typeof ScramjetServiceWorkerRuntime;
|
||||
}
|
||||
}
|
||||
|
||||
self.ScramjetServiceWorkerRuntime = ScramjetServiceWorkerRuntime;
|
Loading…
Add table
Add a link
Reference in a new issue