Using existing userDataDir causes unknown failure with open tabs
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.13.0
- Platform / OS version: MacOS 10.13.6 and Chrome 74
- URLs (if applicable):
- Node.js version: 10.15.3
What steps will reproduce the problem?
I’m running this very basic code below and attempting to run puppeteer using my own chrome profile with userDataDir
.
const puppeteer = require('puppeteer');
(async () => {
try {
const browser = await puppeteer.launch({
executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
headless: false,
userDataDir: '/Users/xxxx/Library/Application Support/Google/Chrome'
});
const page = await browser.newPage();
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
await page.goto('https://google.com');
await page.waitFor(10000);
await browser.close();
}
catch (e)
{
console.log(e)
}
})();
What is the expected result? Opening a new tab in my already open browser with my user profile.
What happens instead?
It fails silently (without any error message). An about:blank page does open as normal, but the other tab (google.com) does not.
$ node index.js
Error: Failed to launch chrome!
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/Users/xxxx/.../node_modules/puppeteer/lib/Launcher.js:342:14)
at ChildProcess.helper.addEventListener (/Users/xxxx/.../node_modules/puppeteer/lib/Launcher.js:332:60)
at ChildProcess.emit (events.js:194:15)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Weirdly however, it does work somewhat when chrome is quit completely. It opens a new chrome with the correct, unsynced, profile. It also works when headless is set to true
. It seems to be similar to issue 2099.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:9 (2 by maintainers)
Top Results From Across the Web
how to use user-data-dir but for multiple puppeteer windows
So what I am trying to do is to open puppeteer window with my google profile, but what I want is ...
Read more >Chrome --user-data-dir not working properly?
The User Data folder is the profile. Copy the existing C:\Users\username\AppData\Local\Google\Chrome\User Data folder to something like ...
Read more >79 - Allow user to specify template user data dir - chromedriver
Use the following bat file to start ChromeDriver ... I was wondering what causes the channel automation error that I see when I...
Read more >Open Browser with Custom Profile - Katalon Studio
I would use an existing Chrome user (no matter how it is named I should ... Error: Reason: org.openqa.selenium.WebDriverException: unknown ...
Read more >Downloads - ChromeDriver - WebDriver for Chrome
If you are using Chrome version 94, please download ChromeDriver 94.0. ... Resolved issue 3690: ChromeDriver fails if extensions use chrome.windows API.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Folks, please don’t run two browser instances that point to the same chromium profile. This will result in undefined behavior.
Hi @zhiqinx what do you mean by ‘run service in safari’? What do i have to run in safari. I didn’t really get that.