mirror of
https://github.com/AgentDeskAI/browser-tools-mcp.git
synced 2025-07-03 15:11:20 +00:00
refactor: improve Chrome launcher error handling in browser detection
This commit is contained in:
parent
4f7eefaa20
commit
246566c258
@ -360,9 +360,18 @@ async function findBrowserExecutablePath(): Promise<string> {
|
|||||||
console.log("Chrome launched but couldn't determine executable path");
|
console.log("Chrome launched but couldn't determine executable path");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// Check if it's a ChromeNotInstalledError
|
||||||
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||||
|
if (
|
||||||
|
errorMessage.includes("No Chrome installations found") ||
|
||||||
|
(error as any)?.code === "ERR_LAUNCHER_NOT_INSTALLED"
|
||||||
|
) {
|
||||||
|
console.log("Chrome not installed. Falling back to manual detection");
|
||||||
|
} else {
|
||||||
console.error("Failed to find Chrome using chrome-launcher:", error);
|
console.error("Failed to find Chrome using chrome-launcher:", error);
|
||||||
console.log("Falling back to manual detection");
|
console.log("Falling back to manual detection");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If chrome-launcher failed, use manual detection
|
// If chrome-launcher failed, use manual detection
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user