mockko / livereload

LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
http://livereload.com/
1.18k stars 56 forks source link

LiveReload not working in Firefox 4 due to missing WebSocket support #70

Closed justmoon closed 13 years ago

justmoon commented 13 years ago

Mozilla removed WebSocket support from Firefox 4:

http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/

This causes LiveReload to fail with

LiveReload Failed to establish connection WebSocket is not defined

A workaround is to go to about:config and set network.websocket.override-security-block to true.

NV commented 13 years ago

It's written on Mozilla add-ons site:

LiveReload uses WebSockets. To make LiveReload work you have to enable WebSockets.

justmoon commented 13 years ago

Ah sorry, didn't see that. Probably doesn't hurt to have this here under Closed Issues in case anyone searches for the error message.

NV commented 13 years ago

Would be nice to have UI that tells user to enable network.websocket.override-security-block if it's not. justmoon, what do you think?

justmoon commented 13 years ago

Hmm, sure, maybe something like this?

if (!WebSocket && navigator.userAgent.indexOf('Firefox/4') != -1) {
    alert("LiveReload requires WebSockets, which are disabled in Firefox 4 by default. Please see the LiveReload page on Mozilla Addons for details and a workaround.");
    return;
}
NV commented 13 years ago

1e2b1742c72ff6ce9fca658630b3b97a969c8334. I chose to tell exactly what to do rather then referring Mozilla Addons site.

Shipped in 0.6.1. https://addons.mozilla.org/firefox/addon/livereload/