Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

XRefresh for Chrome

View README.md

XRefresh for Chrome

Deprecated! Use LiveReload instead.

via xrefresh#17

How to use

  • ruby ws_dir_watcher.rb ~/my_site
  • Open chrome://extensions/
  • "Developer mode", then press "Load unpacked extension" button
  • edit ~/my_site/something and XRefresh reload current tab for you

Similar stuff

Google Chrome Repl

View README.md
1 2 3 4 5 6 7 8 9 10
<script>
var ws = new WebSocket("ws://localhost:41258/");
ws.onmessage = function(e){
try {
chrome.tabs.executeScript(null, {code:'location.reload();'});
} catch (er) {
console.warn(er);
}
};
</script>
View README.md
1 2 3 4 5 6 7 8 9
{
"name": "XRefresh",
"version": "0.1",
"background_page": "background.html",
"permissions": [
"tabs",
"http://*/*"
]
}
View README.md
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# Usage: ruby ws_dir_watcher.rb ~/my_site
 
require 'em-websocket'
require 'directory_watcher'
 
EM.kqueue = true
dw = DirectoryWatcher.new ARGV[0], :glob => '**/*', :scanner => :em
 
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 41258, :debug => true) do |ws|
ws.onopen {
dw.add_observer {
|*args| args.each {|event|
ws.send event if event[:type] == :modified
}
}
dw.start
}
end
Owner

I suggest you to try Live Reload.

Cool thank you! but anyway.. any thoughts about the reason this is not working

forget it. I thought that it only worked for javascript and css.

Thanks :)

Owner

Your log file looks fine. I just checked, it still works for me. By the way, it doesn't work on file:// scheme, only http://.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.