diff --git a/index.js b/index.js index 5c8aa1f..9edb727 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,8 @@ -var ChromeBrowser = function(baseBrowserDecorator) { +var ChromeBrowser = function(baseBrowserDecorator, args) { baseBrowserDecorator(this); + var flags = args.flags || []; + this._getOptions = function(url) { // Chrome CLI options // http://peter.sh/experiments/chromium-command-line-switches/ @@ -9,9 +11,8 @@ var ChromeBrowser = function(baseBrowserDecorator) { '--no-default-browser-check', '--no-first-run', '--disable-default-apps', - '--start-maximized', - url - ]; + '--start-maximized' + ].concat(flags, [url]); }; }; @@ -26,11 +27,11 @@ ChromeBrowser.prototype = { ENV_CMD: 'CHROME_BIN' }; -ChromeBrowser.$inject = ['baseBrowserDecorator']; +ChromeBrowser.$inject = ['baseBrowserDecorator', 'args']; -var ChromeCanaryBrowser = function(baseBrowserDecorator) { - ChromeBrowser.call(this, baseBrowserDecorator); +var ChromeCanaryBrowser = function(baseBrowserDecorator, args) { + ChromeBrowser.call(this, baseBrowserDecorator, args); var parentOptions = this._getOptions; this._getOptions = function(url) { @@ -50,7 +51,7 @@ ChromeCanaryBrowser.prototype = { ENV_CMD: 'CHROME_CANARY_BIN' }; -ChromeCanaryBrowser.$inject = ['baseBrowserDecorator']; +ChromeCanaryBrowser.$inject = ['baseBrowserDecorator', 'args']; // PUBLISH DI MODULE diff --git a/package.json b/package.json index 1683d19..37d3002 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "author": "Vojta Jina ", "dependencies": {}, "peerDependencies": { - "karma": "~0.9" + "karma": "~0.9.3" }, "license": "MIT" }