replaywebpage 1.5.9 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -6
- package/src/appmain.js +7 -0
- package/src/chooser.js +1 -1
- package/src/embed.js +10 -2
- package/src/loader.js +52 -24
- package/src/pageutils.js +1 -12
- package/sw.js +5 -5
- package/ui.js +243 -243
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replaywebpage",
|
|
3
3
|
"productName": "ReplayWeb.page",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"description": "Serverless Web Archive Replay",
|
|
6
6
|
"repository": "https://github.com/webrecorder/replayweb.page",
|
|
7
7
|
"homepage": "https://replayweb.page/",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "AGPL-3.0-or-later",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
|
12
|
-
"@webrecorder/wabac": "^2.
|
|
12
|
+
"@webrecorder/wabac": "^2.12.0",
|
|
13
13
|
"bulma": "^0.9.3",
|
|
14
14
|
"electron-log": "^4.4.1",
|
|
15
15
|
"electron-updater": "^4.3.9",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"ipfs-core": "^0.10.8",
|
|
19
19
|
"keyword-mark-element": "^0.2.0",
|
|
20
20
|
"lit": "^2.1.1",
|
|
21
|
-
"marked": "^
|
|
21
|
+
"marked": "^4.0.10",
|
|
22
22
|
"mime-types": "^2.1.32",
|
|
23
23
|
"minimist": "^1.2.5",
|
|
24
24
|
"pretty-bytes": "^5.6.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"copy-webpack-plugin": "^9.0.1",
|
|
33
33
|
"css-loader": "^6.2.0",
|
|
34
|
-
"electron": "^
|
|
35
|
-
"electron-builder": "^
|
|
34
|
+
"electron": "^19.0.4",
|
|
35
|
+
"electron-builder": "^23.0.3",
|
|
36
36
|
"electron-notarize": "^1.1.1",
|
|
37
37
|
"http-server": "^13.0.2",
|
|
38
38
|
"mini-css-extract-plugin": "^2.3.0",
|
|
@@ -115,7 +115,8 @@
|
|
|
115
115
|
],
|
|
116
116
|
"extraResources": [
|
|
117
117
|
"plugins-mac"
|
|
118
|
-
]
|
|
118
|
+
],
|
|
119
|
+
"singleArchFiles": "dist/prebuilds/**/*"
|
|
119
120
|
},
|
|
120
121
|
"linux": {
|
|
121
122
|
"category": "Archiving;Utility;",
|
package/src/appmain.js
CHANGED
|
@@ -379,6 +379,13 @@ class ReplayWebApp extends LitElement
|
|
|
379
379
|
this.loadInfo.customColl = this.pageParams.get("customColl");
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
+
if (this.pageParams.get("noWebWorker") === "1") {
|
|
383
|
+
if (!this.loadInfo) {
|
|
384
|
+
this.loadInfo = {};
|
|
385
|
+
}
|
|
386
|
+
this.loadInfo.noWebWorker = true;
|
|
387
|
+
}
|
|
388
|
+
|
|
382
389
|
if (IS_APP && this.sourceUrl.startsWith("file://")) {
|
|
383
390
|
// eslint-disable-next-line no-undef
|
|
384
391
|
const url = new URL(__APP_FILE_SERVE_PREFIX__);
|
package/src/chooser.js
CHANGED
|
@@ -194,7 +194,7 @@ class Chooser extends LitElement
|
|
|
194
194
|
<p class="control is-expanded">
|
|
195
195
|
<input class="file-name input" type="text"
|
|
196
196
|
name="filename" id="filename"
|
|
197
|
-
pattern="((file|http|https|ipfs|s3):\/\/.*\.(warc|warc.gz|zip|wacz|har|wbn|json))|(googledrive:\/\/.+)"
|
|
197
|
+
pattern="((file|http|https|ipfs|s3):\/\/.*\.(warc|warc.gz|zip|wacz|har|wbn|json))|(googledrive:\/\/.+)|(ssb:\/\/.+)"
|
|
198
198
|
.value="${this.fileDisplayName}"
|
|
199
199
|
@input="${this.onInput}"
|
|
200
200
|
autocomplete="off"
|
package/src/embed.js
CHANGED
|
@@ -29,6 +29,7 @@ class Embed extends LitElement
|
|
|
29
29
|
this.embed = null;
|
|
30
30
|
this.reloadCount = 0;
|
|
31
31
|
this.noSandbox = false;
|
|
32
|
+
this.noWebWorker = false;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
static get properties() {
|
|
@@ -56,6 +57,7 @@ class Embed extends LitElement
|
|
|
56
57
|
|
|
57
58
|
deepLink: { type: Boolean },
|
|
58
59
|
noSandbox: { type: Boolean },
|
|
60
|
+
noWebWorker: { type: Boolean },
|
|
59
61
|
|
|
60
62
|
errorMessage: { type: String }
|
|
61
63
|
};
|
|
@@ -126,13 +128,19 @@ class Embed extends LitElement
|
|
|
126
128
|
|
|
127
129
|
const source = new URL(this.source, document.baseURI);
|
|
128
130
|
|
|
129
|
-
|
|
131
|
+
const params = {
|
|
130
132
|
source,
|
|
131
133
|
customColl: this.coll,
|
|
132
134
|
config: this.config,
|
|
133
135
|
basePageUrl: window.location.href.split("#")[0],
|
|
134
136
|
embed: this.embed,
|
|
135
|
-
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
if (this.noWebWorker) {
|
|
140
|
+
params.noWebWorker = "1";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
this.paramString = new URLSearchParams(params).toString();
|
|
136
144
|
|
|
137
145
|
this.hashString = new URLSearchParams({
|
|
138
146
|
url: this.url,
|
package/src/loader.js
CHANGED
|
@@ -27,7 +27,9 @@ class Loader extends LitElement
|
|
|
27
27
|
|
|
28
28
|
this.errorAllowRetry = false;
|
|
29
29
|
|
|
30
|
-
this.pingInterval =
|
|
30
|
+
this.pingInterval = 0;
|
|
31
|
+
|
|
32
|
+
this.noWebWorker = false;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
static get properties() {
|
|
@@ -56,11 +58,18 @@ class Loader extends LitElement
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
initMessages() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
this.noWebWorker = this.loadInfo && this.loadInfo.noWebWorker;
|
|
62
|
+
|
|
63
|
+
if (!this.noWebWorker) {
|
|
64
|
+
// eslint-disable-next-line no-undef
|
|
65
|
+
this.worker = new Worker(__SW_NAME__);
|
|
66
|
+
} else {
|
|
67
|
+
if (!navigator.serviceWorker) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this.worker = navigator.serviceWorker;
|
|
72
|
+
}
|
|
64
73
|
|
|
65
74
|
this.worker.addEventListener("message", (event) => {
|
|
66
75
|
switch (event.data.msg_type) {
|
|
@@ -94,11 +103,16 @@ class Loader extends LitElement
|
|
|
94
103
|
}
|
|
95
104
|
this.progress = this.total;
|
|
96
105
|
this.percent = 100;
|
|
97
|
-
if (this.pingInterval) {
|
|
98
|
-
clearInterval(this.pingInterval);
|
|
99
|
-
}
|
|
100
106
|
this.dispatchEvent(new CustomEvent("coll-loaded", {detail: event.data}));
|
|
101
|
-
|
|
107
|
+
|
|
108
|
+
if (!this.noWebWorker) {
|
|
109
|
+
this.worker.terminate();
|
|
110
|
+
} else {
|
|
111
|
+
if (this.pingInterval) {
|
|
112
|
+
clearInterval(this.pingInterval);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
this.worker = null;
|
|
102
116
|
}
|
|
103
117
|
break;
|
|
104
118
|
}
|
|
@@ -187,15 +201,19 @@ You can select a file to upload from the main page by clicking the 'Choose File.
|
|
|
187
201
|
});
|
|
188
202
|
}
|
|
189
203
|
|
|
190
|
-
this.worker
|
|
191
|
-
|
|
192
|
-
|
|
204
|
+
if (this.worker) {
|
|
205
|
+
if (!this.noWebWorker) {
|
|
206
|
+
this.worker.postMessage(msg);
|
|
207
|
+
} else {
|
|
208
|
+
navigator.serviceWorker.controller.postMessage(msg);
|
|
193
209
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
210
|
+
// ping service worker with messages to avoid shutdown while loading
|
|
211
|
+
// (mostly for Firefox)
|
|
212
|
+
this.pingInterval = setInterval(() => {
|
|
213
|
+
navigator.serviceWorker.controller.postMessage({"msg_type": "ping"});
|
|
214
|
+
}, 15000);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
199
217
|
}
|
|
200
218
|
|
|
201
219
|
googledriveInit() {
|
|
@@ -213,12 +231,22 @@ You can select a file to upload from the main page by clicking the 'Choose File.
|
|
|
213
231
|
}
|
|
214
232
|
|
|
215
233
|
onCancel() {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
234
|
+
if (!this.worker) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const msg = {"msg_type": "cancelLoad", "name": this.coll};
|
|
239
|
+
|
|
240
|
+
if (!this.noWebWorker) {
|
|
241
|
+
this.worker.postMessage(msg);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (navigator.serviceWorker && navigator.serviceWorker.controller) {
|
|
246
|
+
navigator.serviceWorker.controller.postMessage(msg);
|
|
247
|
+
if (this.pingInterval) {
|
|
248
|
+
clearInterval(this.pingInterval);
|
|
249
|
+
}
|
|
222
250
|
}
|
|
223
251
|
}
|
|
224
252
|
|
package/src/pageutils.js
CHANGED
|
@@ -34,17 +34,6 @@ Please try a different browser.
|
|
|
34
34
|
return p;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
// ===========================================================================
|
|
38
|
-
let dbworker = null;
|
|
39
|
-
|
|
40
|
-
function initDBWorker() {
|
|
41
|
-
if (dbworker === null) {
|
|
42
|
-
// eslint-disable-next-line no-undef
|
|
43
|
-
dbworker = new Worker(__SW_NAME__);
|
|
44
|
-
}
|
|
45
|
-
return dbworker;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
37
|
|
|
49
38
|
// ===========================================================================
|
|
50
39
|
async function digestMessage(message, hashtype) {
|
|
@@ -148,4 +137,4 @@ function parseURLSchemeHostPath(url) {
|
|
|
148
137
|
|
|
149
138
|
|
|
150
139
|
export { digestMessage, tsToDate, getTS, getPageDateTS, getReplayLink, sourceToId, parseURLSchemeHostPath,
|
|
151
|
-
registerSW
|
|
140
|
+
registerSW };
|