mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
misc fixes
This commit is contained in:
parent
7e8e9990f4
commit
a58f9bcb63
6 changed files with 26 additions and 8 deletions
|
@ -8,6 +8,8 @@ export const isworker = "WorkerGlobalScope" in self;
|
|||
export const issw = "ServiceWorkerGlobalScope" in self;
|
||||
export const isdedicated = "DedicatedWorkerGlobalScope" in self;
|
||||
export const isshared = "SharedWorkerGlobalScope" in self;
|
||||
export const isemulatedsw =
|
||||
new URL(self.location.href).searchParams.get("dest") === "serviceworker";
|
||||
|
||||
dbg.log("scrammin");
|
||||
// if it already exists, that means the handlers have probably already been setup by the parent document
|
||||
|
@ -15,9 +17,7 @@ if (!(ScramjetClient.SCRAMJET in self)) {
|
|||
const client = new ScramjetClient(self);
|
||||
client.hook();
|
||||
|
||||
if (
|
||||
new URL(self.location.href).searchParams.get("dest") === "serviceworker"
|
||||
) {
|
||||
if (isemulatedsw) {
|
||||
const runtime = new ScramjetServiceWorkerRuntime(client);
|
||||
runtime.hook();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue