Skip to content

Commit 48ea084

Browse files
authored
Add the chrome executable path to use installed browsers.
Only doing the change if people want to use installed browsers.
1 parent 1b997ce commit 48ea084

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/toolHandler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ async function ensureBrowser(browserSettings?: BrowserSettings) {
197197
browserInstance = chromium;
198198
break;
199199
}
200+
// Read the Chrome executable path from the environment variable
201+
const executablePath = process.env.PLAYWRIGHT_CHROME_EXECUTABLE_PATH || undefined; // Fallback to default if not set
200202

201-
browser = await browserInstance.launch({ headless });
203+
browser = await browserInstance.launch({ headless, executablePath });
202204
currentBrowserType = browserType;
203205

204206
// Add cleanup logic when browser is disconnected
@@ -620,4 +622,4 @@ export function getScreenshots(): Map<string, string> {
620622
return screenshotTool?.getScreenshots() ?? new Map();
621623
}
622624

623-
export { registerConsoleMessage };
625+
export { registerConsoleMessage };

0 commit comments

Comments
 (0)