2

For some reason, firefox on OS X has decided to ignore CSS styles.

When I point firefox to stackoverflow, it looks like some cheesy site from the early 90s.

This is only happening on a Mac laptop when I use firefox. Safari and Chrome work fine. Firefox in a Windows VM works fine. None of my other machines have this problem with firefox. None of the other stack exchange sites (meta, superuser, serverfault) have this problem, even in firefox on this machine. Nothing unusual happened. Firefox didn't crash or anything. It just decided this morning that from now on, this one site shall ignore CSS styles!

Is there something I can tweak in firefox to make it stop doing this?

Update: Thanks for the responses, but it seems to have stopped on its own one day later.

2
  • 1. Clear your cache 2. Check that adblock (if you have it) isn't blocking the css file. 3. Reboot if you haven't already.
    – Daisetsu
    Jun 19, 2010 at 0:41
  • I have the same problem since months with Firefox on Linux (I'm using Chrome since then to visit stackexchange). The problem is even with -safe-mode (i.e. without any extensions). Looking at the error console, Firefox complains about an 'illegal character' in the file downloaded from cdn.sstatic.net/js/stub.js?v=f3ba9bf843c1 . This seems to be a gzipped javascript file and for some reason firefox seems to interpret it without unzipping it. Jun 25, 2011 at 16:01

3 Answers 3

1

Various thoughts:

  • Maybe the StackOverflow CSS file in your Firefox cache got corrupted. Try emptying Firefox's cache and try again.

  • Login to the guest account and see if you have the same problem from Firefox in the guest account.

  • Install the "Firebug" HTML/CSS/DOM/JS debugger into Firefox and use it to inspect what's going on.

1

I had the same problem since months with Firefox on Linux (i.e. across reboots and cache clearing but on only one of two similarly installed machines). The site looked like bare html (without any styles applied) and things such as voting buttons did not work.

Short answer: In my case the the problem was that the Firefox parameter network.http.accept-encoding (in about:config) was set to the empty string. Resetting it to its default value

gzip, deflate

makes Stackoverflow work again.

Longer answer:

I saw the problem even with -safe-mode (i.e. with all extensions disabled). Looking at the error console, Firefox complains about an 'illegal character' in the data of http://cdn.sstatic.net/js/stub.js?v=f3ba9bf843c1 . This seems to be a gzipped javascript file (downloaded it by hand and ran file on it) and for some reason Firefox seems to interpret it without unzipping it. Then there are consecutive javascript errors about unknown symbols (which are defined in this gzipped javascript file).

Looking at the HTTP traffic, one sees (with my original, problematic setting):

Request:

GET /js/stub.js?v=f3ba9bf843c1 HTTP/1.1
Host: cdn.sstatic.net
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://stackoverflow.com/

Note that there is no field Accept-Encoding indicating that Firefox is ready to accept gzipped data.

HTTP response to this:

HTTP/1.1 200 OK
Server: nginx/0.8.36
Date: Sat, 25 Jun 2011 16:53:21 GMT
Content-Type: application/x-javascript
Connection: keep-alive
Cache-Control: max-age=604800
Content-Encoding: gzip                
Last-Modified: Fri, 24 Jun 2011 13:33:57 GMT
ETag: "64cd5e5e7332cc1:0"
Vary: Accept-Encoding
Content-Length: 6464
X-Cache: HIT
Accept-Ranges: bytes

so the nginx server responds with a Content-Encoding field set to gzip, ignoring the clients capabilities. I'm not sure but this looks to me like a violation on the server side.

After setting the Firefox parameter network.http.accept-encoding to its factory setting value, the http communication for the above javascript file looks as follows:

Request:

GET /js/stub.js?v=f3ba9bf843c1 HTTP/1.1
Host: cdn.sstatic.net
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate    
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://stackoverflow.com/

Now Firefox tells the server it accepts gzipped data.

Response:

HTTP/1.1 200 OK
Server: nginx/0.8.36
Date: Sat, 25 Jun 2011 17:02:08 GMT
Content-Type: application/x-javascript
Connection: keep-alive
Cache-Control: max-age=604800
Content-Encoding: gzip
Last-Modified: Fri, 24 Jun 2011 13:33:57 GMT
ETag: "64cd5e5e7332cc1:0"
Vary: Accept-Encoding
Content-Length: 6464
X-Cache: HIT
Accept-Ranges: bytes
0

I sometimes have this problem after Firefox has been running long enough. Quitting Firefox, reloading the page, then shift-reloading to clear page cache and reload generally resolves the issue.

Not the answer you're looking for? Browse other questions tagged .