bid-tool/auto-bid-tool/system/browser.js

24 lines
861 B
JavaScript

// import puppeteer from 'puppeteer';
import puppeteer from 'puppeteer-extra';
import CONSTANTS from './constants.js';
import StealthPlugin from 'puppeteer-extra-plugin-stealth';
puppeteer.use(StealthPlugin());
const browser = await puppeteer.launch({
headless: process.env.ENVIRONMENT === 'prod' ? true : false,
// userDataDir: CONSTANTS.PROFILE_PATH, // Thư mục lưu profile
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-backgrounding-occluded-windows',
'--disable-renderer-backgrounding',
'--disable-ipc-flooding-protection',
'--disable-features=CalculateNativeWinOcclusion,AudioServiceOutOfProcess',
'--disable-background-timer-throttling',
'--ignore-certificate-errors',
'--start-maximized',
],
});
export default browser;