I\'m editing an HTML file in Vim and I want the browser to refresh whenever the file underneath changes.
Is there a plugin for Google Chrome that will listen for ch
There is a java app for os x and Chrome called Refreschro. It will monitor a given set of files on the local file system and reload Chrome when a change is detected:
http://neromi.com/refreschro/
A quick solution that I sometimes use is to divide the screen into two, and each time a change is made, click on the document xD .
<script>
document.addEventListener("click", function(){
window.location.reload();
})
</script>
Use Gulp to watch the files and Browsersync to reload the browser.
The steps are:
In the command line execute
npm install --save-dev gulp browser-sync
Create gulpfile.js with the following contents:
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task('serve', function() {
browserSync.init({
server: {
baseDir: "./"
}
});
gulp.watch("*.html").on("change", reload);
});
Run
gulp serve
Edit HTML, save and see your browser reload. The magic is done through on-the-fly injection of special tag into your HTML files.
pip install https://github.com/joh/when-changed/archive/master.zip
alias watch_refresh_chrome=" when-changed -v -r -1 -s ./ osascript -e 'tell application \"Google Chrome\" to tell the active tab of its first window to reload' "
then just enter the directory you want to monitor execute "watch_refresh_chrome"
With the addition of a single meta tag into your document, you can instruct the browser to automatically reload at a provided interval:
<meta http-equiv="refresh" content="3" >
Placed within the head tag of your document, this meta tag will instruct the browser to refresh every three seconds.
This can be done using a simple python script.
Full details can be referred here.