Skip to content

Commit 2c0b7f4

Browse files
author
Andrey Taranov
committed
feat(config): Allow --user-data-dir to be set in launcher properties
Introduce a new parameter to custom launder properties: `chromeUserDir` which allows to set the `--user-data-dir` command line option to point to a specific place. Rationale: Sometimes it is useful to run Chrome under Karma with certain plugins loaded. One use-case is to have the **JetBrains IDE Support** plugin to attach the IntelliJ debugger. We can do it with `--load-extension` but this can also be prohibited by corporate policy. So one way to solve it is to have the `--user-data-dir` point to a project subdirectory and to install the plugin manually on the first run. It is preserved of course on subsequent runs.
1 parent b11effd commit 2c0b7f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var ChromeBrowser = function (baseBrowserDecorator, args) {
2121
baseBrowserDecorator(this)
2222

2323
var flags = args.flags || []
24+
var userDataDir = args.chromeDataDir || this._tempDir
2425

2526
this._getOptions = function (url) {
2627
// Chrome CLI options
@@ -32,7 +33,7 @@ var ChromeBrowser = function (baseBrowserDecorator, args) {
3233
})
3334

3435
return [
35-
'--user-data-dir=' + this._tempDir,
36+
'--user-data-dir=' + userDataDir,
3637
'--no-default-browser-check',
3738
'--no-first-run',
3839
'--disable-default-apps',

0 commit comments

Comments
 (0)