Emdash source with visual editor image upload fix

Fixes:
1. media.ts: wrap placeholder generation in try-catch
2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
2026-05-03 10:44:54 +07:00
parent 78f81bebb6
commit 2d1be52177
2352 changed files with 662964 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/**
* Chrome DevTools virtual WebAuthn authenticator for passkey e2e.
* Chromium-only (CDP). See https://developer.chrome.com/docs/devtools/webauthn/
*/
import type { Page } from "@playwright/test";
export async function addVirtualWebAuthnAuthenticator(page: Page): Promise<() => Promise<void>> {
const session = await page.context().newCDPSession(page);
await session.send("WebAuthn.enable");
const { authenticatorId } = await session.send("WebAuthn.addVirtualAuthenticator", {
options: {
protocol: "ctap2",
transport: "internal",
hasResidentKey: true,
hasUserVerification: true,
isUserVerified: true,
automaticPresenceSimulation: true,
},
});
return async () => {
try {
await session.send("WebAuthn.removeVirtualAuthenticator", { authenticatorId });
} catch {
// session may already be closed
}
try {
await session.detach();
} catch {
// ignore
}
};
}