mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:18:27 +00:00
fix(browser): harden CDP readiness
This commit is contained in:
@@ -15,11 +15,16 @@ export function registerBrowserBasicRoutes(
|
||||
return jsonError(res, 503, "browser server not started");
|
||||
}
|
||||
|
||||
const reachable = await ctx.isReachable(300);
|
||||
const [cdpHttp, cdpReady] = await Promise.all([
|
||||
ctx.isHttpReachable(300),
|
||||
ctx.isReachable(600),
|
||||
]);
|
||||
res.json({
|
||||
enabled: current.resolved.enabled,
|
||||
controlUrl: current.resolved.controlUrl,
|
||||
running: reachable,
|
||||
running: cdpReady,
|
||||
cdpReady,
|
||||
cdpHttp,
|
||||
pid: current.running?.pid ?? null,
|
||||
cdpPort: current.cdpPort,
|
||||
chosenBrowser: current.running?.exe.kind ?? null,
|
||||
@@ -47,4 +52,13 @@ export function registerBrowserBasicRoutes(
|
||||
jsonError(res, 500, String(err));
|
||||
}
|
||||
});
|
||||
|
||||
app.post("/reset-profile", async (_req, res) => {
|
||||
try {
|
||||
const result = await ctx.resetProfile();
|
||||
res.json({ ok: true, ...result });
|
||||
} catch (err) {
|
||||
jsonError(res, 500, String(err));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user