Alteração na instacia do chrome

pull/21/head
adriano 2023-01-09 20:09:17 -03:00
parent aa36aedd43
commit 0576614473
1 changed files with 17 additions and 3 deletions

View File

@ -70,10 +70,24 @@ export const initWbot = async (whatsapp: Whatsapp, backupSessionRestore: boolean
// }); // });
// usando instancia do chrome // usando instancia do chrome
// const wbot: Session = new Client({
// session: sessionCfg, authStrategy: new LocalAuth({ clientId: 'bd_' + whatsapp.id }),
// // puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || undefined },
// puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || '/usr/bin/google-chrome-stable' },
// });
const args:String = process.env.CHROME_ARGS || "";
const wbot: Session = new Client({ const wbot: Session = new Client({
session: sessionCfg, authStrategy: new LocalAuth({ clientId: 'bd_' + whatsapp.id }), session: sessionCfg,
// puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || undefined }, authStrategy: new LocalAuth({ clientId: 'bd_' + whatsapp.id }),
puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || '/usr/bin/google-chrome-stable' }, puppeteer: {
executablePath: process.env.CHROME_BIN || undefined,
// @ts-ignore
browserWSEndpoint: process.env.CHROME_WS || undefined,
args: args.split(' ')
}
}); });