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
This commit is contained in:
@@ -447,6 +447,7 @@ export class ReplayWebApp extends LitElement {
|
||||
if (this.useRuffle) {
|
||||
qp.set("injectScripts", "ruffle/ruffle.js");
|
||||
}
|
||||
qp.set("serveIndex", "1");
|
||||
query = qp.toString();
|
||||
if (query.length) {
|
||||
name += "?" + query;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user