misc fixes:

- fix file download in chrome
- fix full-text index loading in older wacz files
dependencies: updaate to wabac 2.7.1
bump to 1.4.1
This commit is contained in:
Ilya Kreymer
2021-04-29 13:44:24 -07:00
parent 03d8e8ffdc
commit 0f08190aca
7 changed files with 21 additions and 17 deletions
+4
View File
@@ -1,5 +1,9 @@
## CHANGES ## CHANGES
v1.4.1
- Replay: Remove 'download' attribute from anchor tags, which doesn't work in Chrome
- Loading: Fix loading of full-text search index from older wacz
v1.4.0 v1.4.0
- Embed: add 'noSandbox' option to not add sandbox to embed iframe - Embed: add 'noSandbox' option to not add sandbox to embed iframe
- UI: Double-clicking on page entry causes reload. - UI: Double-clicking on page entry causes reload.
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "replaywebpage", "name": "replaywebpage",
"productName": "ReplayWeb.page", "productName": "ReplayWeb.page",
"version": "1.4.0", "version": "1.4.1",
"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/",
@@ -9,7 +9,7 @@
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0", "@fortawesome/fontawesome-free": "^5.13.0",
"@webrecorder/wabac": "^2.7.0", "@webrecorder/wabac": "^2.7.1",
"bulma": "^0.9.2", "bulma": "^0.9.2",
"electron-log": "^4.3.0", "electron-log": "^4.3.0",
"electron-updater": "^4.3.5", "electron-updater": "^4.3.5",
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "replaywebpage", "name": "replaywebpage",
"productName": "ReplayWeb.page", "productName": "ReplayWeb.page",
"version": "1.4.0", "version": "1.4.1",
"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/",
@@ -9,7 +9,7 @@
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0", "@fortawesome/fontawesome-free": "^5.13.0",
"@webrecorder/wabac": "^2.7.0", "@webrecorder/wabac": "^2.7.1",
"bulma": "^0.9.2", "bulma": "^0.9.2",
"electron-log": "^4.3.0", "electron-log": "^4.3.0",
"electron-updater": "^4.3.5", "electron-updater": "^4.3.5",
+2 -2
View File
@@ -245,8 +245,8 @@ class Pages extends LitElement
let curr = lines; let curr = lines;
lines = []; lines = [];
await flex.add(curr); await flex.add(curr);
console.log("added " + count + " " + curr.length); //console.log("added " + count + " " + curr.length);
console.log(flex.info()); //console.log(flex.info());
}; };
for await (const line of ndjson(resp.body.getReader())) { for await (const line of ndjson(resp.body.getReader())) {
+4 -4
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -387,7 +387,7 @@ const oe=new WeakMap,ne=v(e=>t=>{if(!(t instanceof D))throw new Error("unsafeSVG
<div style="display: flex"> <div style="display: flex">
<div class="has-text-centered" style="width: 220px"> <div class="has-text-centered" style="width: 220px">
<wr-anim-logo class="logo" size="48px"></wr-anim-logo> <wr-anim-logo class="logo" size="48px"></wr-anim-logo>
<div style="font-size: smaller; margin-bottom: 1em">${pe?"App":""} v${"1.4.0"}</div> <div style="font-size: smaller; margin-bottom: 1em">${pe?"App":""} v${"1.4.1"}</div>
</div> </div>
${pe?q` ${pe?q`
@@ -1178,7 +1178,7 @@ const oe=new WeakMap,ne=v(e=>t=>{if(!(t instanceof D))throw new Error("unsafeSVG
<a href="#" role="button" class="dropdown-item" @click="${this.onAbout}"> <a href="#" role="button" class="dropdown-item" @click="${this.onAbout}">
<fa-icon class="menu-logo" size="1.0rem" aria-hidden="true" .svg=${this.appLogo}></fa-icon> <fa-icon class="menu-logo" size="1.0rem" aria-hidden="true" .svg=${this.appLogo}></fa-icon>
<span>&nbsp;About ${this.appName}</span> <span>&nbsp;About ${this.appName}</span>
<span class="menu-version">(${"1.4.0"})</span> <span class="menu-version">(${"1.4.1"})</span>
</a> </a>
</div> </div>
</div> </div>
@@ -1497,7 +1497,7 @@ const Et=new WeakMap,Rt=v(e=>t=>{if(!(t instanceof D))throw new Error("unsafeHTM
<div class="">Permission is needed to reload the archive file. (Click <i>Cancel</i> to cancel loading this archive.)</div> <div class="">Permission is needed to reload the archive file. (Click <i>Cancel</i> to cancel loading this archive.)</div>
<button @click="${this.onAskPermission}" class="button is-primary">Show Permission</button> <button @click="${this.onAskPermission}" class="button is-primary">Show Permission</button>
<a href="/" class="button is-danger">Cancel</a> <a href="/" class="button is-danger">Cancel</a>
</div>`;case"waiting":default:return q`<progress class="progress is-primary is-large" style="max-width: 400px"/>`}}async onAskPermission(){"granted"===await this.fileHandle.requestPermission({mode:"read"})&&this.doLoad()}}customElements.define("wr-loader",Ht);var Bt=i(98),Ft=i.n(Bt),Gt=i(99),Wt=i.n(Gt),Vt=i(100),Kt=i.n(Vt),Zt=i(101),Jt=i.n(Zt);class Yt extends re{constructor(){super(),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="date",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts="",this.editing=!1,this.toDeletePages=null,this.toDeletePage=null}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"date",name:"Date"}]}static get properties(){return{active:{type:Boolean},collInfo:{type:Object},currList:{type:Number},filteredPages:{type:Array},sortedPages:{type:Array},query:{type:String},defaultKey:{type:String},loading:{type:Boolean},updatingSearch:{type:Boolean},editable:{type:Boolean},selectedPages:{type:Set},allSelected:{type:Boolean},menuActive:{type:Boolean},sortKey:{type:String},sortDesc:{type:Boolean},isSidebar:{type:Boolean},url:{type:String},ts:{type:String},editing:{type:Boolean},toDeletePages:{type:Object},toDeletePage:{type:Object}}}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}async updated(e){if(e.has("collInfo")?this.updateTextSearch():(e.has("query")||e.has("currList"))&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("query")){this.query?(this.sortKey="",this.sortDesc=!1):(this.sortKey="date",this.sortDesc=!0);const e=this.renderRoot.querySelector("wr-sorter");e&&(e.sortKey=this.sortKey,e.sortDesc=this.sortDesc)}if(e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout(()=>e.scrollIntoView(t),100)}}}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout(()=>this._timedUpdate(),250)}async filter(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query){const e=await this.flex.search(this.query,{limit:25});this.filteredPages=e}else this.filteredPages=[...this.collInfo.pages];0!==this.currList&&await this.filterCurated();for(const e of this.filteredPages){const{timestamp:t,date:i}=ze(e);e.timestamp=t,e.date=i}this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)}async filterCurated(){const e=await fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=(await e.json()).curated;this.filteredPages=t}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}async updateTextSearch(){if(this.updatingSearch)return;this.updatingSearch=!0;let e=0;try{const t=new Wt.a({doc:{id:"id",field:["url","title","text"]},async:!0});this.flex=t;const i=await caches.open("cache:"+this.collInfo.coll),a=this.collInfo.apiPrefix+"/textIndex";let r=await i.match(a);r&&Number(r.headers.get("Content-Length"))||(r=await fetch(this.collInfo.apiPrefix+"/textIndex"),200===r.status&&Number(r.headers.get("Content-Length"))&&i.put(a,r.clone()));let o=[];const n=async()=>{let i=o;o=[],await t.add(i),console.log("added "+e+" "+i.length),console.log(t.info())};for await(const t of Ft()(r.body.getReader()))t.text&&(t.id=++e,o.push(t),e%100==0&&await n());await n()}finally{0===e&&this.flex.add(this.collInfo.pages),this.updatingSearch=!1}await this.filter()}static get styles(){return be(ie` </div>`;case"waiting":default:return q`<progress class="progress is-primary is-large" style="max-width: 400px"/>`}}async onAskPermission(){"granted"===await this.fileHandle.requestPermission({mode:"read"})&&this.doLoad()}}customElements.define("wr-loader",Ht);var Bt=i(98),Ft=i.n(Bt),Gt=i(99),Wt=i.n(Gt),Vt=i(100),Kt=i.n(Vt),Zt=i(101),Jt=i.n(Zt);class Yt extends re{constructor(){super(),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="date",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts="",this.editing=!1,this.toDeletePages=null,this.toDeletePage=null}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"date",name:"Date"}]}static get properties(){return{active:{type:Boolean},collInfo:{type:Object},currList:{type:Number},filteredPages:{type:Array},sortedPages:{type:Array},query:{type:String},defaultKey:{type:String},loading:{type:Boolean},updatingSearch:{type:Boolean},editable:{type:Boolean},selectedPages:{type:Set},allSelected:{type:Boolean},menuActive:{type:Boolean},sortKey:{type:String},sortDesc:{type:Boolean},isSidebar:{type:Boolean},url:{type:String},ts:{type:String},editing:{type:Boolean},toDeletePages:{type:Object},toDeletePage:{type:Object}}}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}async updated(e){if(e.has("collInfo")?this.updateTextSearch():(e.has("query")||e.has("currList"))&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("query")){this.query?(this.sortKey="",this.sortDesc=!1):(this.sortKey="date",this.sortDesc=!0);const e=this.renderRoot.querySelector("wr-sorter");e&&(e.sortKey=this.sortKey,e.sortDesc=this.sortDesc)}if(e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout(()=>e.scrollIntoView(t),100)}}}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout(()=>this._timedUpdate(),250)}async filter(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query){const e=await this.flex.search(this.query,{limit:25});this.filteredPages=e}else this.filteredPages=[...this.collInfo.pages];0!==this.currList&&await this.filterCurated();for(const e of this.filteredPages){const{timestamp:t,date:i}=ze(e);e.timestamp=t,e.date=i}this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)}async filterCurated(){const e=await fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=(await e.json()).curated;this.filteredPages=t}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}async updateTextSearch(){if(this.updatingSearch)return;this.updatingSearch=!0;let e=0;try{const t=new Wt.a({doc:{id:"id",field:["url","title","text"]},async:!0});this.flex=t;const i=await caches.open("cache:"+this.collInfo.coll),a=this.collInfo.apiPrefix+"/textIndex";let r=await i.match(a);r&&Number(r.headers.get("Content-Length"))||(r=await fetch(this.collInfo.apiPrefix+"/textIndex"),200===r.status&&Number(r.headers.get("Content-Length"))&&i.put(a,r.clone()));let o=[];const n=async()=>{let e=o;o=[],await t.add(e)};for await(const t of Ft()(r.body.getReader()))t.text&&(t.id=++e,o.push(t),e%100==0&&await n());await n()}finally{0===e&&this.flex.add(this.collInfo.pages),this.updatingSearch=!1}await this.filter()}static get styles(){return be(ie`
:host { :host {
width: 100%; width: 100%;
height: 100%; height: 100%;
+4 -4
View File
@@ -760,10 +760,10 @@
"@webassemblyjs/wast-parser" "1.9.0" "@webassemblyjs/wast-parser" "1.9.0"
"@xtuc/long" "4.2.2" "@xtuc/long" "4.2.2"
"@webrecorder/wabac@^2.7.0": "@webrecorder/wabac@^2.7.1":
version "2.7.0" version "2.7.1"
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.7.0.tgz#d1f54d7faf99aa0333c2ad805b72602dc2b95df1" resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.7.1.tgz#129b57f7560647c7f1376ac1ff3435ed4b926d86"
integrity sha512-AShk6WfVS3ZYvGfT1ernMAH2uHOemUs62NsiA/oVb6OGwUW0BCVCKkzomyQOLaYxcTqza5nWs73Z+8yVimYq6A== integrity sha512-2uv5s4nimdwlUxGVj/4Fh7Hq9Tsg4txX6H/BG0+4OVMIK6dXA6/Fq9qr+kIV9rbequ4CGvfuAczn8x9WetZM6A==
dependencies: dependencies:
"@webrecorder/wombat" "^3.1.4" "@webrecorder/wombat" "^3.1.4"
brotli "github:foliojs/brotli.js" brotli "github:foliojs/brotli.js"