Skip to content

Commit

Permalink
feat(config): Allow --user-data-dir to be set in launcher properties
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andrey Taranov committed Dec 17, 2015
1 parent b11effd commit 2c0b7f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var ChromeBrowser = function (baseBrowserDecorator, args) {
baseBrowserDecorator(this)

var flags = args.flags || []
var userDataDir = args.chromeDataDir || this._tempDir

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

return [
'--user-data-dir=' + this._tempDir,
'--user-data-dir=' + userDataDir,
'--no-default-browser-check',
'--no-first-run',
'--disable-default-apps',
Expand Down

0 comments on commit 2c0b7f4

Please sign in to comment.