diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..53152e6
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,33 @@
+module.exports = {
+ "env": {
+ "browser": true,
+ "es6": true
+ },
+ "extends": "eslint:recommended",
+ "parserOptions": {
+ "ecmaVersion": 2018,
+ "sourceType": "module"
+ },
+ "rules": {
+ "no-restricted-globals": [
+ 2,
+ "event", "error"
+ ],
+ "indent": [
+ "error",
+ 2
+ ],
+ "linebreak-style": [
+ "error",
+ "unix"
+ ],
+ "quotes": [
+ "error",
+ "double"
+ ],
+ "semi": [
+ "error",
+ "always"
+ ]
+ }
+};
diff --git a/CHANGES.md b/CHANGES.md
index 3bf9458..d18647d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,22 @@
## CHANGES
+v1.4.0
+- Embed: add 'noSandbox' option to not add sandbox to embed iframe
+- UI: Double-clicking on page entry causes reload.
+- UI: Fix location bar enter not always reloading specified URL
+- UI: Fix 'Purge and Reload' to reload current page
+- UI: Fix initial load not properly waiting for service worker
+- UI: Show 'Loading Archives...' on initial load, until first API response succeeds, instead of 'No Archives'
+- Fidelity: Improved fuzzy matching for dynamic sites
+- Fidelity: Fix for multipart/form-data replay dropping certain query params
+- Fidelity: don't remove spaces in css urls
+- Fidelity: Better detection of JSON responses served in response to 'Accept: application/json' but with wrong content-type
+- Docs: copy package.json to 'data' to allow access to version in UI, use latest fixed version in Collec
+- API: Switch from /wabac/ -> /w/ for replay paths, make path configurable
+- Extensibility: Make file chooser, collection list more extensible/stylable (for use with archiveweb.page)
+- Lint pass on code base
+- Dependencies: wabac 2.7.0, bulma 0.9.2, electron 11.4.3
+
v1.3.15
- Fidelity: fix encoding issues with UTF-8 encoded JS/CSS introduced in 1.3.13 (fixed via wabac 2.6.9)
- Dependencies: wabac 2.6.9
diff --git a/_config.yml b/_config.yml
index 8596dd0..c60f861 100644
--- a/_config.yml
+++ b/_config.yml
@@ -22,10 +22,6 @@ logo: "/assets/logo.svg"
plugins:
- jekyll-remote-theme
-
-version:
- - 1.3.12
-
#baseUrl: '/'
exclude:
diff --git a/docs/embedding.md b/docs/embedding.md
index 790f400..0d3e00f 100644
--- a/docs/embedding.md
+++ b/docs/embedding.md
@@ -23,7 +23,7 @@ the following snippet to your HTML page:
my-web-archive-embed.html
```html
-
+
```
@@ -39,7 +39,7 @@ one-line script
./replay/sw.js
```javascript
-importScripts("https://cdn.jsdelivr.net/npm/replaywebpage@{{ site.version }}/sw.js");
+importScripts("https://cdn.jsdelivr.net/npm/replaywebpage@{{ site.data.package.version }}/sw.js");
```
Thus, if the HTML snippet was added to `https://my-site.example.com/path/my-web-archive-embed.html`
@@ -71,16 +71,17 @@ The `` tag is a web component and supports a number of addition
| `replayBase` | Location of the `sw.js` file, defaults to `./replay/` as mentioned above, but can be overridden. |
| `coll` | Internal id for this collection, usually generated automatically.
| `config` | Extra per collection config options (such as custom fuzzy matching rules, TODO add more info!) |
+| `noSandbox` | (`true` / `false`) if set to true, don't wrap iframe in `sandbox`. Used as extra precaution to avoid escaping iframe, but prevents PDFs from loading in embed archive. Set for archives of known/trusted sites. |
### Versioning
Note that the above example uses the paths as, which is a CDN for Javascript packages at a specific version:
-- `https://cdn.jsdelivr.net/npm/replaywebpage@{{ site.version }}/ui.js`
-- `https://cdn.jsdelivr.net/npm/replaywebpage@{{ site.version }}/sw.js`
+- `https://cdn.jsdelivr.net/npm/replaywebpage@{{ site.data.package.version }}/ui.js`
+- `https://cdn.jsdelivr.net/npm/replaywebpage@{{ site.data.package.version }}/sw.js`
-These URLs point to a specific version of ReplayWeb.page software released on NPM, eg. `{{ site.version }}`, meaning that your replay should stay stable, even if ReplayWeb.page is updated.
+These URLs point to a specific version of ReplayWeb.page software released on NPM, eg. `{{ site.data.package.version }}`, meaning that your replay should stay stable, even if ReplayWeb.page is updated.
Although ReplayWeb.page strives to remain backwards compatible, this addresses any potential issue of older embeds breaking when the replay system is updated.
diff --git a/package.json b/package.json
index 2a603e0..ca0aaca 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "replaywebpage",
"productName": "ReplayWeb.page",
- "version": "1.3.15",
+ "version": "1.4.0",
"description": "Serverless Web Archive Replay",
"repository": "https://github.com/webrecorder/replayweb.page",
"homepage": "https://replayweb.page/",
@@ -9,8 +9,8 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
- "@webrecorder/wabac": "^2.6.9",
- "bulma": "^0.9.0",
+ "@webrecorder/wabac": "^2.7.0",
+ "bulma": "^0.9.2",
"electron-log": "^4.3.0",
"electron-updater": "^4.3.5",
"fetch-ndjson": "^1.1.0",
@@ -28,7 +28,7 @@
"devDependencies": {
"copy-webpack-plugin": "^6.3.0",
"css-loader": "^3.5.3",
- "electron": "^11.3.0",
+ "electron": "^11.4.3",
"electron-builder": "^22.7.0",
"electron-notarize": "^1.0.0",
"http-server": "^0.12.3",
@@ -62,7 +62,8 @@
"start-jekyll": "yarn run build-docs && bundle exec jekyll serve",
"dist": "yarn run build && yarn run pack",
"dist-dev": "yarn run build-dev && yarn run pack",
- "release": "yarn run build && electron-builder"
+ "release": "yarn run build && electron-builder",
+ "lint": "eslint ./src/ webpack.config.js"
},
"build": {
"afterSign": "build/notarize.js",
diff --git a/src/appmain.js b/src/appmain.js
index 524497e..06e7c6a 100644
--- a/src/appmain.js
+++ b/src/appmain.js
@@ -1,11 +1,11 @@
-import { LitElement, html, css } from 'lit-element';
-import { wrapCss, rwpLogo, IS_APP, clickOnSpacebarPress } from './misc';
+import { LitElement, html, css } from "lit-element";
+import { wrapCss, rwpLogo, IS_APP, VERSION, clickOnSpacebarPress } from "./misc";
-import { registerSW } from './pageutils';
+import { registerSW } from "./pageutils";
-import fasHelp from '@fortawesome/fontawesome-free/svgs/solid/question-circle.svg';
-import fasArrowLeft from '@fortawesome/fontawesome-free/svgs/solid/arrow-left.svg';
-import fasArrowRight from '@fortawesome/fontawesome-free/svgs/solid/arrow-right.svg';
+import fasHelp from "@fortawesome/fontawesome-free/svgs/solid/question-circle.svg";
+import fasArrowLeft from "@fortawesome/fontawesome-free/svgs/solid/arrow-left.svg";
+import fasArrowRight from "@fortawesome/fontawesome-free/svgs/solid/arrow-right.svg";
// ===========================================================================
@@ -16,7 +16,7 @@ class ReplayWebApp extends LitElement
this.sourceUrl = null;
this.collTitle = null;
this.showAbout = false;
- this.pageParams = {};
+ this.pageParams = new URLSearchParams();
this.inited = false;
this.navMenuShown = false;
@@ -25,6 +25,9 @@ class ReplayWebApp extends LitElement
this.pageTitle = "";
this.pageReplay = false;
+ this.loadInfo = null;
+
+ // eslint-disable-next-line no-undef
registerSW(__SW_NAME__);
this.safariKeyframes();
@@ -52,7 +55,7 @@ class ReplayWebApp extends LitElement
pageTitle: { type: String },
pageReplay: { type: Boolean },
source: { type: String }
- }
+ };
}
static get styles() {
@@ -168,30 +171,30 @@ class ReplayWebApp extends LitElement
/
${this.pageReplay ? html`${this.pageTitle}` : this.pageTitle}
- ` : ``}
+ ` : ""}
`: html`
`}
${!this.sourceUrl ? html`
-