Atempt to open a page with `headless: true` and userDataDir relative path hangs with high CPU load
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.9.0-post (chromium_revision 599821)
- Platform / OS version: Windows 7 x64
- URLs (if applicable): any?
- Node.js version: 11.0.0 (or 12.0.0-v8-canary)
What steps will reproduce the problem?
This script is OK:
'use strict';
const puppeteer = require('puppeteer');
(async function main() {
try {
const browser = await puppeteer.launch({
headless: true,
});
const [page] = await browser.pages();
await page.goto('https://example.org/');
console.log(await page.evaluate(() => document.title));
await browser.close();
} catch (err) {
console.error(err);
}
})();
This hangs with high CPU load and no error messages:
'use strict';
const puppeteer = require('puppeteer');
(async function main() {
try {
const browser = await puppeteer.launch({
headless: true,
userDataDir: 'test-profile-dir',
});
const [page] = await browser.pages();
await page.goto('https://example.org/');
console.log(await page.evaluate(() => document.title));
await browser.close();
} catch (err) {
console.error(err);
}
})();
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Atempt to open Canary in headless mode and user data dir ...
Issue 900952: Atempt to open Canary in headless mode and user data dir relative path hangs with high CPU load on Windows. Reported...
Read more >How to open a Chrome Profile through --user-data-dir ...
This loads the browser with my profile like i want, but the browser then hangs for 60 seconds and times out without advancing...
Read more >Chrome --user-data-dir not working properly?
What you can do is 1. Copy your current User Data folder (with said guest profile) to a NEW DIRECTORY 2. Point chrome...
Read more >Advanced configuration - GitLab Docs
Absolute path to a directory where build caches are stored in context of selected executor. For example, locally, Docker, or SSH. If the...
Read more >Arma 3: Startup Parameters - Bohemia Interactive Community
Steam. Choose the game in Steam\Library; Right click on the game; Select properties; Hit "Set launch options".
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
Can’t
launch
just callresolve
onuserDataDir
? Just wondered why my script that ran under macOS didn’t do anything under Windows… Disabled headless and it worked. Then found this. Hangs on navigation:{ userDataDir: 'user_data', headless: true }
. Workaround:{ userDataDir: resolve('user_data'), headless: true }
.I have the same problem when i set userDataDir,Very high CPU consumption