-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loading: keep 'serveIndex' query arg on all sw.js loads, not just in …
…embed.js (#242) fixes embed 'purge cache + reload' bump to 1.8.12
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import INDEX_HTML from "../index.html"; | ||
|
||
import { SWReplay } from "@webrecorder/wabac/src/swmain"; | ||
|
||
import { WorkerLoader } from "@webrecorder/wabac/src/loaders"; | ||
|
||
if (self.registration) { | ||
const staticData = new Map(); | ||
|
||
const prefix = self.registration.scope; | ||
|
||
staticData.set(prefix, { type: "text/html", content: INDEX_HTML }); | ||
staticData.set(prefix + "index.html", { | ||
type: "text/html", | ||
content: INDEX_HTML, | ||
}); | ||
|
||
const sp = new URLSearchParams(self.location.search); | ||
|
||
const defaultConfig = {}; | ||
|
||
if (sp.get("ruffle") == "1") { | ||
defaultConfig.injectScripts = ["ruffle/ruffle.js"]; | ||
} | ||
|
||
self.sw = new SWReplay({ staticData, defaultConfig }); | ||
} else { | ||
new WorkerLoader(self); | ||
} |