Feb 06 2009
Bad MIME-type hack
Occasionally you come across a file online which you know to be a text file, but has been given a MIME type that the browser doesn’t recognise. Internet Explorer does something called MIME-type sniffing — which is to say, it reads the beginning of the file and tries to determine what type it actually is. I’m not here to debate the merits of this tactic, only to point out that Firefox doesn’t do this, and will instead prompt you to save the file or open it with something else.
This is a really intensely irritating behaviour. There should be a third option, Open in Firefox as… but there isn’t. If the file is a text file you can cheat. Copy the URL into the address bar and prefix the whole thing with view-source:.
For example, if
http://www.example.com/mypage.txt
doesn’t load properly, load this page instead
view-source:http://www.example.com/mypage.txt
Comments Off