Skip to content

Instantly share code, notes, and snippets.

@chrisl8888
Last active October 29, 2015 00:49
Show Gist options
  • Select an option

  • Save chrisl8888/629a934aa70f268be994 to your computer and use it in GitHub Desktop.

Select an option

Save chrisl8888/629a934aa70f268be994 to your computer and use it in GitHub Desktop.
Gulp open chrome in windows with arguments borrowed from - https://github.com/karma-runner/karma/issues/479
gulp.task('open', function (done) {
var uri = 'http://localhost:' + CONFIG.PORT + '/tms.html';
var spawn = require('child_process').spawn,
tempDir = 'C:/temp-chrome-eng';
var args = [
'--user-data-dir=' + tempDir,
'--no-default-browser-check',
'--no-first-run',
'--disable-default-apps',
'--start-maximized',
uri
];
var cmd = 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe';
var chrome = spawn(cmd, args);
});
@chrisl8888

Copy link
Copy Markdown
Author

For a more sophisticated example utilize karma-chrome-launcher (https://github.com/karma-runner/karma-chrome-launcher/blob/master/index.js)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment