chore(browser): format CDP helpers

This commit is contained in:
Peter Steinberger
2026-01-01 16:19:37 +00:00
parent c8c84bc419
commit a248bea50f
2 changed files with 14 additions and 13 deletions

View File

@@ -353,14 +353,17 @@ async function canOpenWebSocket(
): Promise<boolean> {
return await new Promise<boolean>((resolve) => {
const ws = new WebSocket(wsUrl, { handshakeTimeout: timeoutMs });
const timer = setTimeout(() => {
try {
ws.terminate();
} catch {
// ignore
}
resolve(false);
}, Math.max(50, timeoutMs + 25));
const timer = setTimeout(
() => {
try {
ws.terminate();
} catch {
// ignore
}
resolve(false);
},
Math.max(50, timeoutMs + 25),
);
ws.once("open", () => {
clearTimeout(timer);
try {