Skip to content

Commit 449e829

Browse files
authored
fix youtube capture + bump wabac.js to 2.19.1 (#230)
- deps: bump to wabac 2.19.1 - add new html rx rewriting (from wabca.js 2.19.x) to fix youtube - bump to 0.12.2
1 parent bcf1dd7 commit 449e829

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@webrecorder/archivewebpage",
33
"productName": "ArchiveWeb.page",
4-
"version": "0.12.1",
4+
"version": "0.12.2",
55
"main": "index.js",
66
"description": "Create Web Archives directly in your browser",
77
"repository": "https://github.com/webrecorder/archiveweb.page",
@@ -11,7 +11,7 @@
1111
"@fortawesome/fontawesome-free": "^5.13.0",
1212
"@ipld/car": "^5.3.1",
1313
"@webrecorder/awp-sw": "^0.4.4",
14-
"@webrecorder/wabac": "^2.18.3",
14+
"@webrecorder/wabac": "^2.19.1",
1515
"auto-js-ipfs": "^2.3.0",
1616
"browsertrix-behaviors": "^0.6.0",
1717
"btoa": "^1.2.1",

src/recorder.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { RequestResponseInfo } from "./requestresponseinfo.js";
22

3-
import { baseRules as baseDSRules } from "@webrecorder/wabac/src/rewrite";
3+
import { baseRules as baseDSRules, htmlRules as htmlDSRules } from "@webrecorder/wabac/src/rewrite";
44
import { rewriteDASH, rewriteHLS } from "@webrecorder/wabac/src/rewrite/rewriteVideo";
55
import { Buffer } from "buffer";
66

@@ -988,6 +988,8 @@ class Recorder {
988988
let newString = null;
989989
let string = null;
990990

991+
const { url, extraOpts } = reqresp;
992+
991993
const ct = this._getContentType(params.responseHeaders);
992994

993995
switch (ct) {
@@ -1007,13 +1009,13 @@ class Recorder {
10071009
case "text/javascript":
10081010
case "application/javascript":
10091011
case "application/x-javascript": {
1010-
const rw = baseDSRules.getRewriter(params.request.url);
1012+
const rules = ct === "text/html" ? htmlDSRules : baseDSRules;
1013+
const rw = rules.getRewriter(url);
10111014

1012-
if (rw !== baseDSRules.defaultRewriter) {
1013-
string = payload.toString("utf-8");
1014-
newString = rw.rewrite(string, {live: true, save: reqresp.extraOpts});
1015+
if (rw !== rules.defaultRewriter) {
1016+
string = payload.toString();
1017+
newString = rw.rewrite(string, {live: true, save: extraOpts});
10151018
}
1016-
break;
10171019
}
10181020
}
10191021

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -984,15 +984,15 @@
984984
uuid "^9.0.0"
985985
warcio "^2.2.1"
986986

987-
"@webrecorder/wabac@^2.17.3", "@webrecorder/wabac@^2.18.1", "@webrecorder/wabac@^2.18.3":
988-
version "2.18.3"
989-
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.18.3.tgz#eda195452a9964e8216fb0676d5da6cc69239dae"
990-
integrity sha512-qmNLXky9QHpljt0EyEmcO6L2qFGG63mZbMYKso0MZZLFY3NeUf/ANafq9pWWm1Bw10+zoV6KRtHUin8gropccA==
987+
"@webrecorder/wabac@^2.17.3", "@webrecorder/wabac@^2.18.1", "@webrecorder/wabac@^2.19.1":
988+
version "2.19.1"
989+
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.19.1.tgz#ce0d609f9e90c708af99945e1fa338be0ba2b5f9"
990+
integrity sha512-m8Fi70OkhzkicbcbN5TrrBpj5D/EZKzVp5905kGPoC2F2zLqxUDMzx1FOHt2sTO/1b9NMvBmw9Pk1JQyYEm6rA==
991991
dependencies:
992992
"@peculiar/asn1-ecc" "^2.3.4"
993993
"@peculiar/asn1-schema" "^2.3.3"
994994
"@peculiar/x509" "^1.9.2"
995-
"@webrecorder/wombat" "^3.7.6"
995+
"@webrecorder/wombat" "^3.7.8"
996996
acorn "^8.10.0"
997997
auto-js-ipfs "^2.1.1"
998998
base64-js "^1.5.1"
@@ -1013,10 +1013,10 @@
10131013
stream-browserify "^3.0.0"
10141014
warcio "^2.2.1"
10151015

1016-
"@webrecorder/wombat@^3.7.6":
1017-
version "3.7.6"
1018-
resolved "https://registry.yarnpkg.com/@webrecorder/wombat/-/wombat-3.7.6.tgz#e52a1bcfccd0150517989bc4310a03730a1f74e7"
1019-
integrity sha512-SA34StdLc+D60Aa8bZ2I+8PLjody1B/j9DmZ2zyXg/EZuPLSG4ec6XvMzq8QYuoGvD+hkjAf0YlUGxmI/viIcw==
1016+
"@webrecorder/wombat@^3.7.8":
1017+
version "3.7.8"
1018+
resolved "https://registry.yarnpkg.com/@webrecorder/wombat/-/wombat-3.7.8.tgz#a414278b6fbd99bc02a97e384f0373307e60d9fa"
1019+
integrity sha512-BmEHrvGLHPQtECmCK9Oz7G3p2StsyaFOlNmAMDSNK/GjqPH+UWZOqDryBkWryTh+pFZXKblqyotLtvR4YxVyeQ==
10201020
dependencies:
10211021
warcio "^2.2.0"
10221022

0 commit comments

Comments
 (0)