0

I am using grunt-contrib-connect for a local dev server and want to write a task to launch google chrome after server starts. But want to pass following arguments to open it in insecure mode.

--args --disable-web-security --user-data-dir

I tried grunt-open to do that but didn't find any options to pass flags.

Any help is appreciated.

Gaurang
  • 313
  • 1
  • 9

1 Answers1

0

You should be able to use grunt-exec to do what you need. A configuration like this works for me:

grunt.config.init({
    ...
    exec: {
        chrome: {
            cmd: '"C:/Program Files (x86)/Google/Chrome/Application/chrome" --incognito http://washingtonpost.com'
        }
    }
    ...
});

Note that, on Windows, quotes are required around the path to the executable. If you're fortunate enough to be using less annoying OS, you won't need them.

cartant
  • 57,105
  • 17
  • 163
  • 197