Today I released wsreload 2.0 which is IMHO a neat tool to increase productivity.
NB: As it depends on inotify, it’s only available on linux (if you are interested in making it work on other OS feel free to make a pull request :D)
NB: As of now it is only compatible with google chrome / chromium. Nothing prevents it to work under other browsers though, except from the fact that someone has to port the chrome extension code to his preferred browser again : pull request :)
Reloading your tabs
wsreload has one aim: making you forget about the
Every local file opened in your browser with a
file:// scheme will be automatically synchronized with the file.
Selective tabs reloading
But that’s not all of it, wsreload comes with a handy executable:
wsreload which can reload any tab matching a criteria when a file is modified.
For example, I’m currently using it while writing the draft of this blog post.
The following command:
tells the browser to reload all tabs that match the following url pattern :
http://localhost:4000/* whenever a file in the
_site/ directory is modified.
(This is the directory in which jekyll generates this site.)
With it my draft preview is automatically reloaded every time I save the markdown file
(in conjunction with
jekill serve -w which regenerates the site when a file change).
wsreload command comes with several matching criteria:
These rules follow the chrome extension api tabs query criteria
To forget about the
F5 key you have to install the wsreload library like any other python package:
Then start the server using:
or if you are using systemd:
And finally just install the wsreload chrome extension like any other chrome extension. That’s it !
In a following post I will write about the technical details behind all of this.