johnbintz/rack-livereload

Works perfectly on Safari, but not Firefox and Chrome (OS X 10.7)

Closed this issue · 6 comments

This is really great stuff, but sadly it doesn't work for me in Firefox and Chrome, only Safari does. Any idea what could be the problem? I use all the newest versions of Rails, browsers, gems, etc.

Any console errors? Is the script getting injected into the page? What browser versions?

  • Firefox 13.0
  • Google Chrome 20.0.1132.43

The page's source contains the following in the head:

  <script type="text/javascript">
    WEB_SOCKET_SWF_LOCATION = "/__rack/WebSocketMain.swf";

  </script>
  <script type="text/javascript" src="/__rack/swfobject.js"></script>
  <script type="text/javascript" src="/__rack/web_socket.js"></script>

<script type="text/javascript" src="/__rack/livereload.js?host=localhost"></script>

No console errors (Firefox and Chrome running, Safari closed):

josh$ guard
Guard uses GNTP to send notifications.
Guard is now watching at '/Users/josh/Documents/Work/MuheimWebdesign/tttt'
Bundle already up-to-date
LiveReload 1.6 is waiting for a browser to connect.
Starting Spork for RSpec, Cucumber
Using RSpec
Using Cucumber
Preloading Rails environment
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
Spork is ready and listening on 8990!
Spork is ready and listening on 8989!
Spork server for RSpec, Cucumber successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--drb", "-f", "progress", "-r", "/Users/josh/.rvm/gems/ruby-1.9.3-p0@tttt/gems/guard-rspec-1.1.0/lib/guard/rspec/formatters/notification_rspec.rb", "-f", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--failure-exit-code", "2", "spec"]...
..............................

Finished in 0.52929 seconds
30 examples, 0 failures
Done.

Reloading browser: /assets/application.css

The last line happens when I edit some CSS, nothing happens in Firefox and Chrome (but would work in Safari if opened).

I checked Firefox' console, and when reloading the page, this error is generated:

Timestamp: 6/27/12 4:09:28 PM
Error: The connection to ws://localhost:35729/livereload was interrupted while the page was loading.
Source File: http://localhost:3000/__rack/livereload.js?host=localhost
Line: 185

When updating something in the application.css, then no warning or stuff is generated.

Can you remove everything else from your Guardfile but what is necessary to run your application and LiveReload and see if you have the same problem?

Hey, it's working now! No idea why it didn't before. I removed the browser extensions, then commented out everything in the Guard file except the livereload stuff, and it worked. I uncommented the other stuff, restarted Guard, and it still works.

I will have to configure another project today, let's see whether it works immediately there.

Awesome extension, by the way. thank you!

I removed all the guard-livereload related gems from my Gemfile, and it still works. Nice!

Yay computers! :D