From 1bc5ffa9fee0d8267c6af76de6edcea19e48eb25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Wed, 7 Oct 2026 16:41:44 +0200 Subject: [PATCH] Don't abort blob URLs in e2e tests The remote request guard read the empty hostname of a `blob:` URL as remote, so embed previews never loaded in tests. --- tests/support/fixtures.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/support/fixtures.ts b/tests/support/fixtures.ts index 86bd7f22c..b451787b1 100644 --- a/tests/support/fixtures.ts +++ b/tests/support/fixtures.ts @@ -79,7 +79,12 @@ export const test = base.extend<{ const playwrightLabel = " ".repeat(23) + "→ " + chalk.yellowBright("playwright") + ": "; - function isLocalhost(url: URL) { + function isLocalhost(url: URL): boolean { + // A blob URL has no hostname of its own; it belongs to the origin + // that created it. + if (url.protocol === "blob:") { + return isLocalhost(new URL(url.pathname)); + } return url.hostname === "localhost" || url.hostname === "127.0.0.1"; }