Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Refresh Browser #3

Closed
pyrossh opened this issue May 13, 2014 · 5 comments
Closed

Refresh Browser #3

pyrossh opened this issue May 13, 2014 · 5 comments

Comments

@pyrossh
Copy link

pyrossh commented May 13, 2014

There should be some way to refresh the currently opened browser so that you can reload/refresh the page when some file changes. This would make it easier for developing static websites and phonegap/cordova applications

@stephenlacy
Copy link
Owner

You could use gulp-open on first run, then use gulp-livereload on all subsequent builds:
https://github.com/vohof/gulp-livereload
I'm traveling right now and will see if I can create an example by the 21st.
Nag me if I do not. ;)

@stephenlacy
Copy link
Owner

How to open the file the first time, then reload it afterwards:

var open = require('gulp-open');
var livereload = require('gulp-livereload');

var opened = false;
gulp.task('open', function(){
  if (opened == false) {
    gulp.src("./index.html")
    .pipe(open());
    opened = true;
  }
  else {
    gulp.src("./index.html")
    .pipe(livereload());
  }
});

@pyrossh
Copy link
Author

pyrossh commented May 23, 2014

Yesh!! Now I can get on with some awesome coding.>!!>

@stephenlacy
Copy link
Owner

All right, I will close this now.

@simkessy
Copy link

What if you're not working locally and you can't use livereload? I push my files to a remote server (Office 365) and I just need the tab to refresh when I make updates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants