chore: run format and fix sandbox browser timeouts

This commit is contained in:
Peter Steinberger
2026-01-16 09:18:53 +00:00
parent 7c34883267
commit 4965727f39
32 changed files with 17548 additions and 15412 deletions

View File

@@ -1,11 +1,6 @@
import fs from "node:fs";
import {
appendCdpPath,
createTargetViaCdp,
getHeadersWithAuth,
normalizeCdpWsUrl,
} from "./cdp.js";
import { appendCdpPath, createTargetViaCdp, getHeadersWithAuth, normalizeCdpWsUrl } from "./cdp.js";
import {
isChromeCdpReady,
isChromeReachable,
@@ -55,10 +50,7 @@ async function fetchJson<T>(url: string, timeoutMs = 1500, init?: RequestInit):
const ctrl = new AbortController();
const t = setTimeout(() => ctrl.abort(), timeoutMs);
try {
const headers = getHeadersWithAuth(
url,
(init?.headers as Record<string, string>) || {},
);
const headers = getHeadersWithAuth(url, (init?.headers as Record<string, string>) || {});
const res = await fetch(url, { ...init, headers, signal: ctrl.signal });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return (await res.json()) as T;
@@ -71,10 +63,7 @@ async function fetchOk(url: string, timeoutMs = 1500, init?: RequestInit): Promi
const ctrl = new AbortController();
const t = setTimeout(() => ctrl.abort(), timeoutMs);
try {
const headers = getHeadersWithAuth(
url,
(init?.headers as Record<string, string>) || {},
);
const headers = getHeadersWithAuth(url, (init?.headers as Record<string, string>) || {});
const res = await fetch(url, { ...init, headers, signal: ctrl.signal });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
} finally {