feat: respect PUPPETEER_EXECUTABLE_PATH

chatgpt-api-old-v3
Travis Fischer 2022-12-18 04:07:24 -06:00
rodzic 1752169b8b
commit 94da95c325
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -360,6 +360,10 @@ export async function getBrowser(
* Gets the default path to chrome's executable for the current platform.
*/
export const defaultChromeExecutablePath = (): string => {
if (process.env.PUPPETEER_EXECUTABLE_PATH) {
return process.env.PUPPETEER_EXECUTABLE_PATH
}
switch (os.platform()) {
case 'win32':
return 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'