mirror of
https://github.com/AgentDeskAI/browser-tools-mcp.git
synced 2025-06-27 00:41:26 +00:00
refactor: improve Chrome launcher error handling in browser detection
This commit is contained in:
parent
4f7eefaa20
commit
246566c258
@ -360,8 +360,17 @@ async function findBrowserExecutablePath(): Promise<string> {
|
||||
console.log("Chrome launched but couldn't determine executable path");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to find Chrome using chrome-launcher:", error);
|
||||
console.log("Falling back to manual detection");
|
||||
// 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.log("Falling back to manual detection");
|
||||
}
|
||||
}
|
||||
|
||||
// If chrome-launcher failed, use manual detection
|
||||
|
Loading…
x
Reference in New Issue
Block a user