Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open the chrome browser with gulp-open?

I am using gulp-open with gulp in windows 7:

gulp.task('op', function(){
    var options = {
        uri: 'localhost:8080',
        app: 'chrome'
    };
    gulp.src(__filename)
        .pipe(open(options));
});

The index.html file opens with the app when I use app:'Firefox' but when I use the chrome option it opens an empty index.html? How can I fix this?

like image 551
bier hier Avatar asked Dec 15 '22 09:12

bier hier


1 Answers

Depending on the OS you need to refer to the chrome app differently in options:

'google-chrome' // Linux 

'chrome' // Windows 

'google chrome' or 'Google Chrome' // OSX 

Refer to section Options.app in the NPM documentation about gulp-open.

like image 197
joeyfb Avatar answered Dec 17 '22 00:12

joeyfb