downloadUrl support for multiWACZ + latest wabac (#407)

main menu tweaks:
- use downloadUrl for action menu download
- don't show download menu if downloadUrl is null
- don't show Archive Info if downloadUrl !== sourceUrl and in embed mode

improved loading: update to wabac.js 2.21.3

bump to 2.3.3, update CHANGES for release
This commit is contained in:
Ilya Kreymer
2025-03-04 11:37:20 -08:00
committed by GitHub
parent 64dc599532
commit 2ef95985cd
5 changed files with 46 additions and 27 deletions
+6
View File
@@ -2,6 +2,12 @@
## CHANGES ## CHANGES
v2.3.3
- UI: Support custom 'downloadUrl' when loading from Multi-WACZ JSON source - don't show download if unset
- UI: Don't show 'Archive Info' menu option for Multi-WACZ JSON source in embed mode
- UI: Use localized data format for current language settings
- Loading: Use negative offset range requests (via wabac.js 2.21.3)
v2.3.2 v2.3.2
- Loading: fix dynamic page lookup for URLs with query strings (via wabac.js 2.21.2) - Loading: fix dynamic page lookup for URLs with query strings (via wabac.js 2.21.2)
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "replaywebpage", "name": "replaywebpage",
"productName": "ReplayWeb.page", "productName": "ReplayWeb.page",
"version": "2.3.2", "version": "2.3.3",
"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/",
@@ -18,7 +18,7 @@
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"@shoelace-style/shoelace": "~2.15.1", "@shoelace-style/shoelace": "~2.15.1",
"@webrecorder/wabac": "^2.21.2", "@webrecorder/wabac": "^2.21.3",
"bulma": "^0.9.3", "bulma": "^0.9.3",
"electron-log": "^4.4.1", "electron-log": "^4.4.1",
"electron-updater": "^6.3.9", "electron-updater": "^6.3.9",
+20 -8
View File
@@ -115,6 +115,9 @@ class Item extends LitElement {
@property({ type: String }) @property({ type: String })
sourceUrl: string | null = null; sourceUrl: string | null = null;
@property({ type: String })
downloadUrl: string | null = null;
@property({ type: Object, attribute: false }) @property({ type: Object, attribute: false })
loadInfo: LoadInfo | null = null; loadInfo: LoadInfo | null = null;
@@ -446,8 +449,16 @@ class Item extends LitElement {
}); });
} }
if (!this.itemInfo!.title) { const { title, name, filename, downloadUrl } = this.itemInfo!;
this.itemInfo!.title = this.itemInfo!.filename;
if (!title) {
this.itemInfo!.title = name || filename;
}
if (downloadUrl === null) {
this.downloadUrl = null;
} else {
this.downloadUrl = downloadUrl || this.sourceUrl;
} }
if (this.embed === "replayonly" || this.embed === "replay-with-info") { if (this.embed === "replayonly" || this.embed === "replay-with-info") {
@@ -1357,11 +1368,11 @@ class Item extends LitElement {
<span>Purge Cache + Full Reload</span> <span>Purge Cache + Full Reload</span>
</a>` </a>`
: html``} : html``}
${(!this.editable && this.sourceUrl?.startsWith("http://")) || ${(!this.editable && this.downloadUrl?.startsWith("http://")) ||
this.sourceUrl?.startsWith("https://") this.downloadUrl?.startsWith("https://")
? html` <hr class="dropdown-divider" /> ? html` <hr class="dropdown-divider" />
<a <a
href="${this.sourceUrl}" href="${this.downloadUrl}"
role="button" role="button"
class="dropdown-item" class="dropdown-item"
@keyup="${clickOnSpacebarPress}" @keyup="${clickOnSpacebarPress}"
@@ -1383,7 +1394,8 @@ class Item extends LitElement {
<span class="menu-head">Capture Date</span>${dateStr} <span class="menu-head">Capture Date</span>${dateStr}
</div>` </div>`
: ""} : ""}
${!this.editable ${!this.editable &&
(this.downloadUrl === this.sourceUrl || !this.embed)
? html` <a ? html` <a
href="#" href="#"
role="button" role="button"
@@ -1398,9 +1410,9 @@ class Item extends LitElement {
></fa-icon> ></fa-icon>
</span> </span>
<span>Archive Info</span> <span>Archive Info</span>
</a> </a>`
<hr class="dropdown-divider" />`
: ``} : ``}
<hr class="dropdown-divider" />
<a <a
href="#" href="#"
role="button" role="button"
+1
View File
@@ -33,6 +33,7 @@ export type ItemType = {
name?: string; name?: string;
title?: string; title?: string;
loadUrl?: string; loadUrl?: string;
downloadUrl?: string | null;
desc?: string; desc?: string;
description?: string; description?: string;
resources?: { path: string; name: string }[]; resources?: { path: string; name: string }[];
+4 -4
View File
@@ -1028,10 +1028,10 @@
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e"
integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==
"@webrecorder/wabac@^2.21.2": "@webrecorder/wabac@^2.21.3":
version "2.21.2" version "2.21.3"
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.21.2.tgz#e19d9165e274a00be33d36b44bb0648a6264871d" resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.21.3.tgz#2a376e848e1bf09dbe98e78a6c41034f8cef80d9"
integrity sha512-Jlr4yLzjR2GiEJ+YZfzSjkhqJsVWPHpgVLmqsDcqoKktap6xoteeasEcbi8vcL/yxtHCnVYzwnt6ZdGbTcu7kg== integrity sha512-RgWFCRj1VEa0o2i8HTIlr5ol3W1C0ySI3cdBb8Q1okSYKzG3Xaqlnui2iTpWiJNgvayKzZs1fTxcQuKz/vMYgQ==
dependencies: dependencies:
"@peculiar/asn1-ecc" "^2.3.4" "@peculiar/asn1-ecc" "^2.3.4"
"@peculiar/asn1-schema" "^2.3.3" "@peculiar/asn1-schema" "^2.3.3"