I have a script that works fine when I use it normally without any arguments but I want it to run in a user specified browser so I don't have to log in every time. if I use:
const browser = await puppeteer.launch({executablePath: '/Volumes/Google Chrome/Google Chrome.app/Contents/MacOS/Google Chrome', userDataDir: '/Users/{myUserName}/Library/Application Support/Google/Chrome', headless: false, args: ['--disable-gpu', '--disable-setuid-sandbox', '--no-sandbox', '--no-zygote']});
const page = await browser.newPage();
return page;
I received: Error: Failed to launch the browser process!
But when I don't use a user data directory my script works fine. So my question is how can I make it so that my script works on the specified user. I got the executable path from, chrome://version.
Thanks in advance