问题
I'm having a fun issue, I have LiveReload working in Chrome, so I know it's installed right, but I can't for the life of me get it going on Firefox 9.0.1. I activate the icon on my site and it just stays red, with the following symptom showing in my guard terminal.
Browser connected.
Browser URL: {"command":"hello","protocols":["http://livereload.com/protocols/connection-check-1"]}
Browser disconnected.
Here's my guardfile.
guard 'livereload' do
watch(%r{app/.+\.(erb|haml)})
watch(%r{app/helpers/.+\.rb})
watch(%r{(public/|app/assets).+\.(css|js|html)})
watch(%r{(app/assets/.+\.css)\.s[ac]ss}) { |m| m[1] }
watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] }
watch(%r{config/locales/.+\.yml})
end
I did some research on the subject and all I can find are people reporting issues and then reporting back that it just cleared up, without any explanation from the developers. Fun!
回答1:
Latest Firefox seems to be unable to inject chrome:// urls into the host page unlees the corresponding resource has additional "contentaccesible" manifest attribute.
I've added that and submitted a pull request: https://github.com/livereload/livereload-extensions/pull/8
You can grab the fixed plugin package here: https://github.com/downloads/siasia/livereload-extensions/LiveReload-2.0.9.xpi
回答2:
I'm in the same boat. Have you tried using the non-browswer extension method:
http://help.livereload.com/kb/general-use/using-livereload-without-browser-extensions
...also, you can use the following gem to automatically inject the script in your test environment:
https://github.com/johnbintz/rack-livereload
回答3:
I had this same problem with Chrome. But it was an error on my part I was accessing my file from:
file:///path/to/myFile.html
So I just setup a webserver to read my file from:
http://localhost/myFile.html
and then livereload connected.
来源:https://stackoverflow.com/questions/8710613/livereload-not-working-guard-firefox