This project contains several scripts that help with automatically reloading a tab in a browser whenever a file changes:
tools/watchdir.jswatches all webdev files (.html, .css, .js) in a directory and reloads the first tab of the frontmost browser window when one of them changes.
tools/watchfile.jsopens a file in a web browser, watches it and reloads the first tab of the frontmost browser window if it changes.
grunt.jsis a Grunt build script. You put it inside a project directory. Its
watchtask is invoked as follows.
This task watches all .asc files in the project directory. If one of them changes, it is converted to HTML via the
asciidoccommand. Afterwards, the first tab of the frontmost browser window is reloaded.
All scripts depend on
node_modules/jsreload. Safari is currently used by the scripts, but that can easily be changed to Chrome by replacing
- Supported browsers: Safari, Chrome
- Mac OS X (reloading a browser currently depends on AppleScript)
- Package: underscore (trivial to install via npm)
- Grunt (only needed for option #2)