From 2044bbe1be985d290bd265ec32624687c8be32d6 Mon Sep 17 00:00:00 2001 From: hallelx2 Date: Tue, 3 Nov 2026 08:23:52 +0100 Subject: [PATCH 1/3] test(extension): run the release e2e on a sandboxed Playwright 1.64.1 The e2e drove Arch's /usr/bin/chromium (155) with Playwright's default of no sandbox. It now uses Playwright's full bundled Chromium (channel "chromium", since chrome-headless-shell cannot load extensions) unless CHROMIUM_PATH names another, with chromiumSandbox on. playwright 1.64.1. --- apps/extension/e2e/release.e2e.mjs | 6 +++++- apps/extension/package.json | 2 +- pnpm-lock.yaml | 18 +++++++++--------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/extension/e2e/release.e2e.mjs b/apps/extension/e2e/release.e2e.mjs index 76acd9a..e0318bd 100644 --- a/apps/extension/e2e/release.e2e.mjs +++ b/apps/extension/e2e/release.e2e.mjs @@ -96,8 +96,12 @@ const fail = (msg) => { }; const profile = mkdtempSync(join(tmpdir(), "bh-ext-profile-")); const launch = () => + // Playwright's full Chromium (channel "chromium": chrome-headless-shell cannot + // load extensions) unless CHROMIUM_PATH names another, always sandboxed. chromium.launchPersistentContext(profile, { - executablePath: process.env.CHROMIUM_PATH ?? "/usr/bin/chromium", + channel: process.env.CHROMIUM_PATH ? undefined : "chromium", + executablePath: process.env.CHROMIUM_PATH || undefined, + chromiumSandbox: true, headless: true, viewport: { width: 1280, height: 800 }, args: [`--disable-extensions-except=${EXT}`, `--load-extension=${EXT}`], diff --git a/apps/extension/package.json b/apps/extension/package.json index af31064..c13b652 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -5,7 +5,7 @@ "description": "BridgeHook browser extension: forward webhooks to localhost", "devDependencies": { "esbuild": "^0.28.2", - "playwright": "1.64.0", + "playwright": "1.64.1", "vitest": "^5.0.3" }, "type": "module", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 772f045..89ca09b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,8 +81,8 @@ importers: specifier: ^0.28.2 version: 0.28.2 playwright: - specifier: 1.64.0 - version: 1.64.0 + specifier: 1.64.1 + version: 1.64.1 vitest: specifier: ^5.0.3 version: 5.0.3(@types/node@25.5.2)(vite@6.4.4(@types/node@25.5.2)(jiti@1.21.7)(tsx@4.23.15)) @@ -2556,13 +2556,13 @@ packages: resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} engines: {node: '>=16.20.0'} - playwright-core@1.64.0: - resolution: {integrity: sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==} + playwright-core@1.64.1: + resolution: {integrity: sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==} engines: {node: '>=20'} hasBin: true - playwright@1.64.0: - resolution: {integrity: sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==} + playwright@1.64.1: + resolution: {integrity: sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==} engines: {node: '>=20'} hasBin: true @@ -4890,11 +4890,11 @@ snapshots: pkce-challenge@5.0.1: {} - playwright-core@1.64.0: {} + playwright-core@1.64.1: {} - playwright@1.64.0: + playwright@1.64.1: dependencies: - playwright-core: 1.64.0 + playwright-core: 1.64.1 postal-mime@2.7.4: {} From 4625a085766111a652d5a2ebf34d288b84bebefe Mon Sep 17 00:00:00 2001 From: hallelx2 Date: Tue, 3 Nov 2026 11:15:37 +0100 Subject: [PATCH 2/3] build(extension): install Playwright's Chromium before the release e2e The e2e now defaults to Playwright's full Chromium instead of /usr/bin/chromium, so the script installs it first. Idempotent, about two seconds once cached. --- apps/extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/extension/package.json b/apps/extension/package.json index c13b652..7e07c44 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -12,7 +12,7 @@ "scripts": { "build:drain": "node scripts/build-drain.mjs", "package": "node scripts/package.mjs", - "e2e": "node e2e/release.e2e.mjs", + "e2e": "playwright install chromium && node e2e/release.e2e.mjs", "test": "vitest run" } } From 73ae77750b6f8d8a9264a313826107ed7312b504 Mon Sep 17 00:00:00 2001 From: hallelx2 Date: Tue, 3 Nov 2026 11:17:57 +0100 Subject: [PATCH 3/3] docs(extension): say which Chromium the release e2e uses, and that it runs sandboxed --- apps/extension/e2e/release.e2e.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/extension/e2e/release.e2e.mjs b/apps/extension/e2e/release.e2e.mjs index e0318bd..274585e 100644 --- a/apps/extension/e2e/release.e2e.mjs +++ b/apps/extension/e2e/release.e2e.mjs @@ -12,9 +12,10 @@ * as the Chrome Web Store requires) to dist/e2e/. * * Needs the QA account in the repo's gitignored .env (BRIDGEHOOK_TEST_EMAIL, - * BRIDGEHOOK_TEST_PASSWORD) or the environment, a Chromium (CHROMIUM_PATH, - * default /usr/bin/chromium; Google Chrome no longer loads unpacked - * extensions from the command line) and port 3456 free. Setup and teardown + * BRIDGEHOOK_TEST_PASSWORD) or the environment, a Chromium (Playwright's own, + * which `pnpm e2e` installs; CHROMIUM_PATH names another; Google Chrome no + * longer loads unpacked extensions from the command line) and port 3456 free. + * The browser runs sandboxed, so run as a normal user, not root. Setup and teardown * revoke the QA account's devices and channels, so runs do not accumulate. */ import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync } from "node:fs";