Failed to load CSS
The stylesheet doesn't load anymore. Any ideas?

Hi @Wideshanks, I will look this today. Could you try to disable/enable the extension again e see if it works (temporarily)? My chrome version is Version 43.0.2357.124 (64-bit), what is yours?
I just notice that the response is an error, I will check this. I believe that it is failing on error responses, I will try to fix it asap.
Errors have anything to do with this bug. I'll keep checking.
I see the new 0.9.0, with the change to MAX_WAIT, but I still have the same behavior.
So I start with a new Chrome profile, only json-viewer 0.9.0 is installed:

Chrome version:

I have the same error as before, but it now takes around 10 seconds for the JSON output to load, still without CSS.

(The example used this time is a successful response, unlike the Facebook github endpoint above.)
The timeline in the image isn't easy to follow, but it's pausing for around 10 seconds and then paints the response on the screen
Network tab shows the document request itself finishing in 500ms.

You can see I also get a 200 response on viewer.css. The URL of the CSS mentioned in the error message in the console is valid and I can access it:

The CSS data is valid and passes csslint.
The stack trace points to this line in load-css.js, in the if (attempts > MAX_WAIT):

It looks like the content var here being compared to loaded or 'loaded':

--ends up being an empty string:

Hi @Wideshanks thanks for this great analysis, I will reopen the issue and try to reproduce this bug again
Hey @Wideshanks I finally found the problem, I will release 0.9.1 version. Thanks for your support and patience.
Well, you replied before I could send this, but here you go anyway:
Spoke too soon. The version above was paused in the debugger on the first loop. The content is empty only for the first attempt (probably the reason you had a loop there to begin with).
If I directly modify the source of the extension to log content:

It's empty only on the first try, subsequent checks have it as "loaded"

So, the check is for single-quotes 'loaded', but my content var is showing double-quotes "loaded". If I change that check, the CSS loads:

Also, I would avoid comparing the number of attempts with a number of milliseconds in MAX_WAIT because the intended 2 second MAX_WAIT may not be 2 seconds, it'll be 2,000 attempts.

I see that each of the attempts has a setTimeout interval of 1ms, but on my machine at least, it takes way longer than 1ms.

Thanks again, 0.9.1 rolling out
@Wideshanks about the MAX_WAIT I agree with you, the intention was to be a number of times, the comment I added about the seconds was wrong, I reverted to 20 attempts and I will change the name of this constant.