Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions css_auto-reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ StyleSheetList.prototype.toggle_autoreload = function toggle_autoreload(){
// usage: document.styleSheets.toggle_autoreload()
return this.start_autoreload.running ? this.stop_autoreload() : this.start_autoreload();
};

StyleSheetList.prototype.reload_on_focus = function reload_on_focus(){
// usage: document.styleSheets.reload_on_focus()
var that = this;
window.onfocus = function () {
that.reload();
};
};