Build native packages with Firefox

This commit is contained in:
ngosang
2021-10-18 11:13:49 +02:00
parent 2408a75a70
commit a841d67745
5 changed files with 47 additions and 22 deletions

View File

@@ -111,11 +111,10 @@ export async function create(session: string, options: SessionCreateOptions): Pr
log.debug('Creating userDataDir for session.')
puppeteerOptions.userDataDir = prepareBrowserProfile(sessionId, options.proxy)
// todo: fix native package with firefox
// if we are running inside executable binary, change browser path
if (typeof (process as any).pkg !== 'undefined') {
const exe = process.platform === "win32" ? 'chrome.exe' : 'chrome';
puppeteerOptions.executablePath = path.join(path.dirname(process.execPath), 'chrome', exe)
const exe = process.platform === "win32" ? 'firefox.exe' : 'firefox';
puppeteerOptions.executablePath = path.join(path.dirname(process.execPath), 'firefox', exe)
}
log.debug('Launching web browser...')