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:
Ilya Kreymer
2023-09-12 21:36:18 -07:00
committed by GitHub
parent 8e715cdf54
commit 81e81dceae
6 changed files with 311 additions and 278 deletions
+3
View File
@@ -1,5 +1,8 @@
## CHANGES ## CHANGES
v1.8.12
- Loading: Fixes embed 'Purge Cache + Reload', ensure '?serveIndex=1' is always set on all service worker loading
v1.8.11 v1.8.11
- Loading: Use default html index, avoid custom html injection (via wabac.js 2.16.12) - Loading: Use default html index, avoid custom html injection (via wabac.js 2.16.12)
- Dependencies: Switch to wabac.js 2.16.12 - Dependencies: Switch to wabac.js 2.16.12
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "replaywebpage", "name": "replaywebpage",
"productName": "ReplayWeb.page", "productName": "ReplayWeb.page",
"version": "1.8.11", "version": "1.8.12",
"description": "Serverless Web Archive Replay", "description": "Serverless Web Archive Replay",
"repository": "https://github.com/webrecorder/replayweb.page", "repository": "https://github.com/webrecorder/replayweb.page",
"homepage": "https://replayweb.page/", "homepage": "https://replayweb.page/",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "replaywebpage", "name": "replaywebpage",
"productName": "ReplayWeb.page", "productName": "ReplayWeb.page",
"version": "1.8.11", "version": "1.8.12",
"description": "Serverless Web Archive Replay", "description": "Serverless Web Archive Replay",
"repository": "https://github.com/webrecorder/replayweb.page", "repository": "https://github.com/webrecorder/replayweb.page",
"homepage": "https://replayweb.page/", "homepage": "https://replayweb.page/",
+1
View File
@@ -426,6 +426,7 @@ class ReplayWebApp extends LitElement {
if (this.useRuffle) { if (this.useRuffle) {
qp.set("injectScripts", "ruffle/ruffle.js"); qp.set("injectScripts", "ruffle/ruffle.js");
} }
qp.set("serveIndex", "1");
query = qp.toString(); query = qp.toString();
if (query.length) { if (query.length) {
name += "?" + query; name += "?" + query;
+29
View File
@@ -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);
}
+276 -276
View File
File diff suppressed because one or more lines are too long