Skip to content

Commit 62c30e7

Browse files
authored
Fix ruffle injection + disable gdrive in library build (#419)
library: disable GDrive integration in library build (for AWP use) fidelity: Fix Ruffle injection, rewriting improvements (via wabac.js 2.22.17) loading: Support .wacz.zip extension for loading WACZ files when .zip is auto-added (eg. on Android devices) deps: bump to wabac.js 2.22.17 bump to 2.3.8
1 parent c0c196c commit 62c30e7

File tree

8 files changed

+22
-10
lines changed

8 files changed

+22
-10
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## CHANGES
44

5+
v2.3.8
6+
7+
- Library: disable GDrive integration in library (for AWP use)
8+
- Fidelity: Fix Ruffle injection, rewriting improvements (via wabac.js 2.22.17)
9+
- Loading: Support .wacz.zip extension for loading WACZ files when .zip is auto-added (eg. on Android devices)
10+
511
v2.3.7
612

713
- Fidelity: Rewriting fixes via wabac.js 2.22.16

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "replaywebpage",
33
"productName": "ReplayWeb.page",
4-
"version": "2.3.7",
4+
"version": "2.3.8",
55
"description": "Serverless Web Archive Replay",
66
"repository": "https://github.com/webrecorder/replayweb.page",
77
"homepage": "https://replayweb.page/",
@@ -22,7 +22,7 @@
2222
"dependencies": {
2323
"@fortawesome/fontawesome-free": "^5.15.4",
2424
"@shoelace-style/shoelace": "~2.15.1",
25-
"@webrecorder/wabac": "^2.22.16",
25+
"@webrecorder/wabac": "^2.22.17",
2626
"bulma": "^0.9.3",
2727
"electron-log": "^4.4.1",
2828
"electron-updater": "^6.3.9",

src/appmain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ export class ReplayWebApp extends LitElement {
461461
let query = "";
462462
if (this.useRuffle) {
463463
qp.set("injectScripts", "ruffle/ruffle.js");
464+
qp.set("allowProxyPaths", "ruffle/");
464465
}
465466
if (this.embed) {
466467
qp.set("serveIndex", "1");

src/chooser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class Chooser extends LitElement {
3939
accept: {
4040
"application/warc": [".warc", ".gz"],
4141
"application/har": [".har"],
42-
"application/wacz": [".wacz"],
42+
"application/wacz": [".wacz", ".wacz.zip"],
4343
"application/json": [".json"],
4444
},
4545
},
@@ -295,7 +295,7 @@ export class Chooser extends LitElement {
295295
type="text"
296296
name="filename"
297297
id="filename"
298-
pattern="((file|http|https|ipfs|s3)://.*.(warc|warc.gz|zip|wacz|har|json|cdx|cdxj)([?#].*)?)|(googledrive://.+)|(ssb://.+)"
298+
pattern="((file|http|https|ipfs|s3)://.*.(warc|warc.gz|zip|wacz|wacz.zip|har|json|cdx|cdxj)([?#].*)?)|(googledrive://.+)|(ssb://.+)"
299299
.value="${this.fileDisplayName}"
300300
@input="${this.onInput}"
301301
autocomplete="off"

src/gdrive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ class GDrive extends LitElement {
194194
}
195195

196196
script() {
197-
if (this.state === "trypublic" || this.scriptLoaded) {
197+
if (this.state === "trypublic" || this.scriptLoaded || !__GDRIVE_API__) {
198198
return html``;
199199
}
200200
const script = document.createElement("script");
201201
script.onload = () => this.onLoad();
202-
script.src = "https://apis.google.com/js/platform.js";
202+
script.src = __GDRIVE_API__;
203203
return script;
204204
}
205205

src/globals.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare module "*.sass";
55
declare const __SW_NAME__: string;
66
declare const __HELPER_PROXY__: string;
77
declare const __GDRIVE_CLIENT_ID__: string;
8+
declare const __GDRIVE_API__: string;
89
declare const __VERSION__: string;
910

1011
// eslint-disable-next-line @typescript-eslint/no-explicit-any

webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const HELPER_PROXY = "https://helper-proxy.webrecorder.workers.dev";
1717
const GDRIVE_CLIENT_ID =
1818
"160798412227-tko4c82uopud11q105b2lvbogsj77hlg.apps.googleusercontent.com";
1919

20+
const GDRIVE_API = "https://apis.google.com/js/platform.js";
21+
2022
// Copyright banner text
2123
const BANNER_TEXT = `'[name].js is part of ReplayWeb.page (https://replayweb.page) Copyright (C) 2020-${new Date().getFullYear()}, Webrecorder Software. Licensed under the Affero General Public License v3.'`;
2224

@@ -155,6 +157,7 @@ const libConfig = (env, argv) => {
155157
__SW_NAME__: JSON.stringify("sw.js"),
156158
__HELPER_PROXY__: JSON.stringify(HELPER_PROXY),
157159
__GDRIVE_CLIENT_ID__: JSON.stringify(GDRIVE_CLIENT_ID),
160+
__GDRIVE_API__: JSON.stringify(""),
158161
__VERSION__: JSON.stringify(package_json.version),
159162
}),
160163
new webpack.BannerPlugin(BANNER_TEXT),
@@ -247,6 +250,7 @@ const browserConfig = (/*env, argv*/) => {
247250
__SW_NAME__: JSON.stringify("sw.js"),
248251
__HELPER_PROXY__: JSON.stringify(HELPER_PROXY),
249252
__GDRIVE_CLIENT_ID__: JSON.stringify(GDRIVE_CLIENT_ID),
253+
__GDRIVE_API__: JSON.stringify(GDRIVE_API),
250254
__VERSION__: JSON.stringify(package_json.version),
251255
}),
252256
new webpack.BannerPlugin(BANNER_TEXT),

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,10 +1028,10 @@
10281028
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e"
10291029
integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==
10301030

1031-
"@webrecorder/wabac@^2.22.16":
1032-
version "2.22.16"
1033-
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.22.16.tgz#8b9684569b373b8e930852bce4512e2bd2810d65"
1034-
integrity sha512-n39kwNOD/bKpAFwQ8AXImFqOUhfqUYoz41E0baGfoXydnJc2LKiS7SMqg3wDHazZH3y2DVlUpPknrD7UM75g0A==
1031+
"@webrecorder/wabac@^2.22.17":
1032+
version "2.22.17"
1033+
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.22.17.tgz#af1992ea78fcd6d82f3ce2a5502504d9763c08d8"
1034+
integrity sha512-IW7GKwE2Eh5xCj9E7OUHqmmMxdWa5GyyaVRijOFrBksgMfRAyiZxrSUlpUtALtwbyEQ1r2a5wjKyCCJE3xWubw==
10351035
dependencies:
10361036
"@peculiar/asn1-ecc" "^2.3.4"
10371037
"@peculiar/asn1-schema" "^2.3.3"

0 commit comments

Comments
 (0)