MozillaZine

Handling of incorrect MIME types

Discussion of features in Mozilla Firefox
Conditional
 
Posts: 6
Joined: October 19th, 2003, 6:46 pm

Post Posted October 19th, 2003, 8:24 pm

I have a functional and almost seamless work-around to fix this, but I get my 5 minutes to rant/rave first.

I am a new Firebird user and <i>almost</i> convert. (I <i>was</i> a convert, and then I <i>was not</i> a convert when I came across this problem, but now I just might be a convert again now that I've fixed it. We'll see...) I like Firebird very very much, but I have one question for the developers.

<b><i>Who are you writing this for?</i></b>

I've already skimmed through a number of Firebird web-pages. The stated purpose of Firebird (that I can recall) is to produce a less bloated version of Mozilla that is more responsive and easier to use. (The unstated purpose is to code something that surpasses everything else in quality and ease of use.) Grabbing quotes from <a href="http://www.mozilla.org/products/firebird/why/"><i>http://www.mozilla.org/products/firebird/why/</i></a>

<blockquote>Mozilla Firebird empowers you to accomplish things online faster and more efficiently than any other browser, period. Offering the industry's best implementations of features such as Tab-Browsing and popup blocking, as well as a horde of other seamless innovations, Firebird stands out ahead of every other web browser.

<b>It's all about YOU</b>

The Mozilla Firebird team has focused on the big picture - improving real world performance and increasing the value you get out of your time online. What are you doing online? How can we make that easier for you? Page layout speed is only one part of the equation. Mozilla Firebird's tools will change the way you browse, they will make browsing more intuitive, more convenient, and at the same time orders of magnitude faster. In fact, we believe you'll at least double what you get out of the internet. Mozilla Firebird's tools work with you, rather than against you, as invisibly as possible.
</blockquote>

To this end, the developers will have failed their end users and (publically implied) product mission statement if they do not come up with a user friendly way of handling misconfigured web server MIME types. Period. Having already provided technical support for a number of years, I'd like to think I know a bit about the end user (in)experience. I don't think that they'll give <i>a rat's tail</i> about W3C standards if the software "don't work". They're not interested in the technical reasons or the philosophical of why it should be <i>this way</i> if "it don't work". They'll happily go back to their other browser and pop-up/ad blockers (cough cough - if any) than use something that either "don't work" or requires work to use.

With that said, here is the work-around I came up with. (I haven't seen anyone else do this... so...)


<ol><li>Install the <a href="http://texturizer.net/firebird/extensions/#Things%20They%20Left%20Out">Things They Left Out</a> extension</li>
<li>Quit and restart Firebird.</li>
<li>Go to Tools -> More Options and select MIME-Types.</li>
<li>Add a new MIME type</li>
<ul><li>MIME type: text/plain</li>
<li>Description: *</li>
<li>Extension: rar wmv zip (binary file extensions that you'd "trust" that obviously aren't text/plain)</li>
<li>When a file of this type is encountered: Save it to disk.</li>
<li>Always ask [x]</li>
</ul><li>Click OK. Click OK.</li>
<li>You're done. It may require a restart.</li></ol>

When you encounter a text/plain .txt file, it will open within Firebird.
When you encounter any of the file types you've specified above, it will save them.
When the download manager is done saving the file, click launch.

Nearly that easy... (I have also installed the IE View extension so that I can right-click on something that displays as text inside of Firebird and have IE figure out what to do with it. We'll see how many additional hoops I have to jump through before I start consider another browser...)

My words may have a slight edge to them, but that's only because I really really <i>do</i> like Firebird (and maybe want to see it succeed). Keep up the good work and have fun!

(If this doesn't work for you, then I have yet another work-around that works just about as smoothly.)
- Conditional

...and if you know of any tech support / project planner/advisor/management jobs in Austin, let me know! :D

MisterBigs
 
Posts: 1
Joined: October 20th, 2003, 9:33 am

Post Posted October 20th, 2003, 9:38 am

I installed your extension and it worked for a while but it will not work now. I've reinstalled it and have tried to make new entries but it still shows text in the browser. Any suggestions?

Conditional
 
Posts: 6
Joined: October 19th, 2003, 6:46 pm

Post Posted October 20th, 2003, 8:14 pm

Don't know why it failed... Hmm...

Failing the first recommendation, install <a href="http://www.proxomitron.info/files/index.shtml">Proxomitron 4.5 June version</a> (Windows only, but I'm certain that there is an easy way of tweaking a proxy server under *NIX to do the same). While this application is no longer being supported, it still works. (Some <i>individual</i> wouldn't stop flaming the author over a feature they didn't like, so the author quit. <i>No, it was not me.</i>)

Once it is installed and configured to start up at system start up, bring up Firebird, go to <i>Tools -> Options: General: Connection Settings.</i> In that window, click on <i>Manual proxy configuration</i>. For <i>HTTP Proxy,</i> type <u>localhost</u>. Port = <u>8080</u>. Click <i>Ok</i>. Click <i>Ok</i>.

Make sure you can still get out to the rest of the world and bring up a web page. Proxomitron is a proxy server that stands between Firebird and the Internet (kinda like a firewall, but not quite). It resides as a server on your computer and <i>should</i> only accept connections from your own computer. It uses a number of very powerful search and replace scripts to filter out the bad things to or from your browser. (We'll be adding a custom filter in just a moment.)

If you're dead in the Internet water after setting the proxy settings, remove the proxy settings and trouble-shoot. If you're okay, then open Proxomitron from the system tray, and click on the <i>Headers</i> button under <i>Edit Filters</i>. Click on <i>New</i>.
<ul><li>For <i>HTTP Header</i>, type <u>Content-Type: Fix Firebird</u>
(because that's exactly what you're doing - it's the one major thing that's broken on it. :P).</li>
<li>For <i>Header value match</i>, type <u>text/plain</u></li>
<li>For <i>Replacement text</i>, type <u>text/fudge</u></li></ul>
Click on <i>Ok</i> as many times as you need to...

This should replace all incoming occurances of "text/plain" with "text/fudge" - a (should be) complelely unknown MIME type. (I fudged it, that's why...) Mozilla / Firebird won't know what to do with it, and it will ask you what it should do.

Save to disk and launch.

...and now for a mini-rant and rave:

Wow... I had no idea I was not able to see alternate style sheets on web pages under IE. (Isn't that part of the CSS 1.0 that they said that they supported?) I was so impressed, I fixed someone else's javascript favelet to allow IE users to be able to toggle through each of them in turn - just so that they could see what they were missing. (I can't quite get it to work as a right-click context menu item, though. :( ) I also learned about CSS (2.0 only)-based menuing systems, and that Mozilla was the first to be able to implement CSS 2.0? (Great work!)

In the process, I also learned about some of those mozilla-specific CSS style sheet settings, like <i>-moz-opacity: (#%)</i>. Um, is that a standard? (cough cough.) I seem to remember seeing a CSS 3.0 proposal for the same thing (<i>rgba(r,g,b,o)</i> to be exact) that was <i>not</i> browser-specific (as -moz-opacity implies itself to be...). So... are the developers going to remove the -moz stuff and go for CSS 3.0 as a <i>standard</i>, or can the misconfigured-on-the-web-server MIME/type of text/plain issue be resolved within Firebird and provide the ease-of-use functionality that was promised?

Sorry for harping on that two days in a row, but when I saw what appears to be Mozilla-specific CSS style statements being used and recognized in Firebird, I couldn't resist... especially since I read somewhere that the MIME/type issue was <i>not</i> going to be addressed because it would "break standards"... I'm hoping that the <i>real</i> reason is that Firebird is still pre 1.0 and that the developers intend to find a way of handling it.

Anyways - the above proxy suggestion should work, but it will rewrite <i>all</i> text/plain MIME types, including those of <i>.txt</i> files. Oh well... give it a try. If anything, Proxomitron adds some very powerful filtering capabilities to Firebird and has an extensive set of filters/recipes of its own (although I bet you can turn off a few of those filters because they're already handled in Firebird). Good luck.

(If that fails, you will probably want to check out some Proxomitron discussion forums to make sure that the rule is set up properly.)
- Conditional

...and if you know of any tech support / project planner/advisor/management jobs in Austin, let me know! :D

Pike

User avatar
 
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK

Post Posted October 21st, 2003, 11:51 am

Conditional wrote:In the process, I also learned about some of those mozilla-specific CSS style sheet settings, like <i>-moz-opacity: (#%)</i>. Um, is that a standard? (cough cough.) I seem to remember seeing a CSS 3.0 proposal for the same thing (<i>rgba(r,g,b,o)</i> to be exact) that was <i>not</i> browser-specific (as -moz-opacity implies itself to be...). So... are the developers going to remove the -moz stuff and go for CSS 3.0 as a <i>standard</i>, or can the misconfigured-on-the-web-server MIME/type of text/plain issue be resolved within Firebird and provide the ease-of-use functionality that was promised?


These vendor-specific extensions are described here:

http://www.w3.org/TR/2003/WD-css3-synta ... r-specific

They are used in Mozilla to implement the user interface which is written in XUL, XBL, Javascript and CSS. Obviously the user interface requires features that are not available in the normal standard, so these features are implemented using a vendor-specific extension starting with -moz.

They are also used to allow implementation of new (CSS3) features, creating a -moz version of the new property allows it to be tested live in the browser without worrying if it doesn't work exactly as it should. When the new feature is complete and 100% compliant with the standard it will be renamed to it's final name by removing the -moz part.

Conditional
 
Posts: 6
Joined: October 19th, 2003, 6:46 pm

Post Posted October 21st, 2003, 1:44 pm

I don't want to get too far off-topic, here. I can appreciate the use of -moz styles as a way to test the implementation of upcoming standards from a coding perspective. To nitpick on standards - the link you have included describes a standard for including non-standards. It's still non-standard (in the same black and white absolute view that I understand is currently being used to address mis-MIME-d types.)

My original point is that the developers won't make it so that Firebird is able to recognize and handle mis-MIME-dd types because there isn't a standard for doing so. (Maybe it should become one... A Request For Comments-RFC, anyone?) Doing so makes it so that the end-user has to jump through more hoops just to use Firebird than they would have with the first browser that was probably installed on their system. (And the end goal of Firebird is to make it easier to use?) Yet, they use -moz CSS styles, which are non-standard. (Because it is easier to develop future features that way?) So it looks as though they'll bend standards for their own ease of development purposes (and then distribute them), but not to make Firebird easier to use for the end user?

I don't want to stray too far down this road of thought because I think it will produce more disagreements than solutions that can go way off topic and not really address the problem. The problem is that Firebird won't deal with mis-MIME-d type intelligently, and that's a problem I'd like to see resolved.

If it is never going to be addressed, then what do we have to do? Put together a development team to do a project based off of Firebird (Firebirdie?) that knows how to deal with mis-MIME-d types intelligently and see how many downloads it gets over Firebird? (I say that because I feel that this should be working when installed and not through an optional extension that requires additional installation steps in order to get it to work.)

(I suppose another work-around that doesn't really fix the problem is to campaign web server developers to preconfigure MIME types as part of their distributions or updates, if they don't already...? It has been a while since I've installed Apache. I wonder what they do by default...)

I'd like to stick to the "Handling of incorrect MIME types" discussion as much as possible. I'll gladly take a philosophical discussion over the implementation of standards in another thread. There are many things I admit that I don't know, and it might prove to be interesting reading.
Last edited by Conditional on October 21st, 2003, 10:18 pm, edited 2 times in total.
- Conditional

...and if you know of any tech support / project planner/advisor/management jobs in Austin, let me know! :D

Pike

User avatar
 
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK

Post Posted October 21st, 2003, 2:42 pm

I think you're being unfair here, including a proprietary feature should always be frowned upon, and can cause problems if its use becomes popular. However doing so does not break any standards whatsoever, the CSS2 properties are in no way mutually exclusive with non-CSS2 properties, if they were we'd have no CSS1 support and the day CSS3 became a standard we'd have to strip out CSS2 support, nor could support for any other stylesheet languages be added. On the other hand ignoring an existing, clearly stated rule such as no content-sniffing if a file has a MIME type does break a standard.

Anyway like you said I'll leave it at that to avoid taking this thread further off course, this detour is pretty much irrelevant, it's just that I object to your comparison between these two issues not necessarily your overall message. :-)

Conditional
 
Posts: 6
Joined: October 19th, 2003, 6:46 pm

Post Posted October 21st, 2003, 5:26 pm

I think the MIME/type standard may be broken if using it diminishes Firebird's ability to do its job. (A new RFC? Anyone?) I'm not attacking the CSS implementation, and the comparison may be a bit unfair as well. (I actually like the -moz stuff, and I use them in addition to the IE filter effect...) I just want to see Firebird deliver, and I see the MIME types as a hurdle that will impact the end-user who just won't understand.
- Conditional

...and if you know of any tech support / project planner/advisor/management jobs in Austin, let me know! :D

dtobias
 
Posts: 2098
Joined: November 9th, 2002, 3:35 pm
Location: Boca Raton, FL

Post Posted October 22nd, 2003, 11:14 am

Some of you are making "apples and oranges" comparisons with regard to standards noncompliance. Not all "nonstandard" things are against the standards in the exact same way, and there are significant differences in the actual and potential problems caused by different kinds of "standards breaking".

On the one hand, adding implementation of things that aren't in the standard, such as the BLINK and MARQUEE tag, the "about:" URI protocol, or various proprietary CSS properties, can be done without in any way impairing the ability of a browser to properly render content that *does* conform to the standards. A standards-compliant document wouldn't include any of these nonstandard tags, properties, and protocols, so what Mozilla does upon encountering them is irrelevant in such a case. Any rendering (or misrendering) of them is purely error correction on Mozilla's part (though sometimes the standards might dictate what sort of reaction the browser ought to have, such as the requirement that unrecognized CSS properties be ignored). There are still standards-related consequences of such implementations, including the possibility that site authors will be thus encouraged to use such nonstandard content because "it works in my favorite browser", to the detriment of Web standards and interoperability, but it needn't happen.

On the other hand, an implementation that *breaks* the standards-based rendering of a document that complies fully with the standards is a much more serious sort of standards noncompliance. As it now stands, it's entirely possible to serve a plain text document, with the correct MIME type, and have it fail to render correctly in MSIE and/or Opera due to those browsers' MIME-second-guessing. I run into this problem all the time when writing maintenance and diagnostic Perl scripts, giving simple status output in plain text when run, but which can't reliably be used as CGI scripts except via the Mozilla browser because the .pl extension causes bizarre misinterpretation on the part of second-guessing browsers.
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/
Dan's Mail Format Site: http://mailformat.dan.info/

Conditional
 
Posts: 6
Joined: October 19th, 2003, 6:46 pm

Post Posted October 23rd, 2003, 2:48 pm

The comparison may not have been fair because I feel as though the attitude towards mis-MIME types has been unfair, and that was my point. There must be some way to determine the intended application for a document without breaking the Internet or exposing security risks.

I'd love to research this one further: from server through standards to (cross-platform) client, but I already have (more than one) work-around that works, and I am in much need of a job. (I must spend my time on that, instead.) I can get the results I want because I know how to tweak things.

The typical end-user, however, won't.

Now if I can figure out why the Quicktime plugin doesn't work... (msg me if you know that one)... I'll search through forums later after I post some more job apps.
- Conditional

...and if you know of any tech support / project planner/advisor/management jobs in Austin, let me know! :D

David H
 
Posts: 2254
Joined: June 13th, 2003, 5:17 am
Location: Japan

Post Posted October 23rd, 2003, 3:01 pm

Conditional wrote: If you're okay, then open Proxomitron from the system tray, and click on the <i>Headers</i> button under <i>Edit Filters</i>. Click on <i>New</i>.
<ul><li>For <i>HTTP Header</i>, type <u>Content-Type: Fix Firebird</u>
(because that's exactly what you're doing - it's the one major thing that's broken on it. :P).</li>


You do realize that the Proxomitron already comes with a mime-type filter set up for you, don't you? All you have to do with it is add the proper entries into the blockfile it uses as you come across them. I have about a dozen entries in mine and I haven't had to add any new ones in ages.

Conditional
 
Posts: 6
Joined: October 19th, 2003, 6:46 pm

Post Posted October 23rd, 2003, 5:20 pm

I only downloaded Proxomitron to see if I could implement a work-around using it.

What you're saying is to do this from within Proxomitron instead (for anyone else):

Config -> Blockfile (tab) -> MIME-list -> Edit

Add additional corrections on seperate lines using the same format in existing lines. Requires knowledge of the correct MIME type per file extension. (Your favorite search engine should be able to find that...)

I don't currently have Proxomitron running. I'm trying to keep things running as lean and mean as possible. (I don't mind extensions.) I've been happy with the filtering in Firebird so far.
- Conditional

...and if you know of any tech support / project planner/advisor/management jobs in Austin, let me know! :D

dtobias
 
Posts: 2098
Joined: November 9th, 2002, 3:35 pm
Location: Boca Raton, FL

Post Posted October 23rd, 2003, 5:48 pm

Conditional wrote:The comparison may not have been fair because I feel as though the attitude towards mis-MIME types has been unfair, and that was my point. There must be some way to determine the intended application for a document without breaking the Internet or exposing security risks.


This "Do What I Mean" thing is just what many of us hate so much about Microsoft products... they second-guess the user in what can sometimes be infuriating, or even dangerous, ways.

Under the standards, the file extensions found in URLs are completely irrelevant. I could save all my HTML files with ".gif" extensions, all my images with ".txt", and all my plain text files with ".zip", and if I serve them with the correct MIME types, a standards-compliant browser will show them all correctly. A browser that tries to decide what I "really meant" by looking at file extensions is likely to screw up badly.
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/
Dan's Mail Format Site: http://mailformat.dan.info/

Magus
 
Posts: 2022
Joined: November 28th, 2002, 11:39 am
Location: that-a-way ->

Post Posted October 24th, 2003, 2:43 pm

So make it as an option. If I want to hit a page like that and get entirely wrong results, that should be my choice, likewise I should be able to tell it to, say, read .rar as .rar regardless of the mime/type.
For every action there is an equal and opposite criticism.

Mattwolf
 
Posts: 5
Joined: November 11th, 2003, 6:40 pm

Post Posted January 3rd, 2004, 9:49 pm

I also ran into this problem and found a temporary work around. My work around isnt pretty and is Windows only...

Install the IEView extention: http://ieview.mozdev.org/ When ever you run into a site where it displays the item as text right click the link and click on the "Open link target in IE" Then IE will open it correctly.

I wish there was a better way but this is the only way I have found that works 100% of the time.

SuperJeff
 
Posts: 62
Joined: May 17th, 2003, 4:23 pm

Post Posted January 5th, 2004, 12:43 am

I believe the 0.8 branch release has a patch in it that solves most (if not all) of these problems, so be sure to try that if you haven't yet.

Return to Firefox Features


Who is online

Users browsing this forum: No registered users and 0 guests