Description
Recently, our organization updated its Chrome policies to disallow launching Chrome without user login.
As a result, when running unit tests via Karma with karma-chrome-launcher, Chrome now prompts for login and immediately shuts down — making automated testing impossible.
After debugging, we found that karma-chrome-launcher internally uses the --user-data-dir flag by default when launching Chrome.
When we manually removed this flag, tests ran successfully without the login prompt.
💡 Suggestion / Feature Request
Please add an option (e.g. in karma.conf.js) to control whether the --user-data-dir flag is used.
Something like:
browsers: ['ChromeCustom'],
customLaunchers: {
ChromeCustom: {
base: 'Chrome',
flags: ['--no-sandbox'],
useUserDataDir: false // new option
}
}
🔍 Why this matters
Some corporate environments enforce Chrome login policies.
In such environments, the default --user-data-dir behavior breaks headless/automated runs.
Giving users control over this flag would make the launcher more flexible and enterprise-friendly.
🧩 Environment
Angular version: [16.x]
karma-chrome-launcher version: [3.1.0]
OS: [Windows 10]
Chrome version: [141.0.x (enterprise-managed)]
Description
Recently, our organization updated its Chrome policies to disallow launching Chrome without user login.
As a result, when running unit tests via Karma with karma-chrome-launcher, Chrome now prompts for login and immediately shuts down — making automated testing impossible.
After debugging, we found that karma-chrome-launcher internally uses the --user-data-dir flag by default when launching Chrome.
When we manually removed this flag, tests ran successfully without the login prompt.
💡 Suggestion / Feature Request
Please add an option (e.g. in karma.conf.js) to control whether the --user-data-dir flag is used.
Something like:
🔍 Why this matters
Some corporate environments enforce Chrome login policies.
In such environments, the default --user-data-dir behavior breaks headless/automated runs.
Giving users control over this flag would make the launcher more flexible and enterprise-friendly.
🧩 Environment
Angular version: [16.x]
karma-chrome-launcher version: [3.1.0]
OS: [Windows 10]
Chrome version: [141.0.x (enterprise-managed)]