From b310b7f8a6940c6b8aa6a81cb6f886d265afb9f5 Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Wed, 1 Apr 2026 20:40:14 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20self-host=20xterm.js=20vendor=20libs=20?= =?UTF-8?q?=E2=80=94=20eliminates=20Edge=20Tracking=20Prevention=20console?= =?UTF-8?q?=20noise?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- muxplex/frontend/index.html | 12 +- muxplex/frontend/tests/test_app.mjs | 35 +++ muxplex/frontend/vendor/addon-image.js | 3 + muxplex/frontend/vendor/xterm-addon-fit.js | 2 + muxplex/frontend/vendor/xterm-addon-search.js | 2 + .../frontend/vendor/xterm-addon-web-links.js | 2 + muxplex/frontend/vendor/xterm.css | 209 ++++++++++++++++++ muxplex/frontend/vendor/xterm.js | 2 + 8 files changed, 261 insertions(+), 6 deletions(-) create mode 100644 muxplex/frontend/vendor/addon-image.js create mode 100644 muxplex/frontend/vendor/xterm-addon-fit.js create mode 100644 muxplex/frontend/vendor/xterm-addon-search.js create mode 100644 muxplex/frontend/vendor/xterm-addon-web-links.js create mode 100644 muxplex/frontend/vendor/xterm.css create mode 100644 muxplex/frontend/vendor/xterm.js diff --git a/muxplex/frontend/index.html b/muxplex/frontend/index.html index 3ce4d9a..bf4a8a1 100644 --- a/muxplex/frontend/index.html +++ b/muxplex/frontend/index.html @@ -10,7 +10,7 @@ - + muxplex @@ -240,11 +240,11 @@ - - - - - + + + + + diff --git a/muxplex/frontend/tests/test_app.mjs b/muxplex/frontend/tests/test_app.mjs index 1c692ce..25e7695 100644 --- a/muxplex/frontend/tests/test_app.mjs +++ b/muxplex/frontend/tests/test_app.mjs @@ -3921,3 +3921,38 @@ test('tile click handler ignores clicks on tile-delete button', () => { "tile click handler must guard against clicks on .tile-delete button" ); }); + +// --- index.html: self-hosted vendor libs (no CDN) --- + +test('index.html loads xterm.css from local /vendor/ path (not CDN)', () => { + const html = fs.readFileSync(new URL('../index.html', import.meta.url), 'utf8'); + assert.ok( + html.includes('href="/vendor/xterm.css"'), + 'index.html must reference /vendor/xterm.css (not CDN)', + ); + assert.ok( + !html.includes('cdn.jsdelivr.net'), + 'index.html must NOT reference cdn.jsdelivr.net', + ); +}); + +test('index.html loads all 5 xterm JS scripts from local /vendor/ paths (not CDN)', () => { + const html = fs.readFileSync(new URL('../index.html', import.meta.url), 'utf8'); + const vendorScripts = [ + '/vendor/xterm.js', + '/vendor/xterm-addon-fit.js', + '/vendor/xterm-addon-web-links.js', + '/vendor/xterm-addon-search.js', + '/vendor/addon-image.js', + ]; + for (const script of vendorScripts) { + assert.ok( + html.includes(`src="${script}"`), + `index.html must include