Open Bug 45441 Opened 25 years ago Updated 2 years ago

[Mac] html files saved without .html extension are viewed as plain text

Categories

(Firefox :: File Handling, defect, P3)

PowerPC
macOS
defect

Tracking

()

People

(Reporter: jelwell, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: helpwanted, Whiteboard: p-safari)

If I open home.netscape.com then do Save Page As... and save the file as "testing". When I open that file in Mozilla I see the HTML code (as plain text). If I open the file in N4.x then I see the HTML web page just fine with pictures... etc. I tried this on mac 2000071310. windows 2000071208 seems to view html, regardless of it's extensions, just fine. i'm putting this in XP Apps, because law already has a few Saving html type bugs. :)
Keywords: nsbeta3
Nav triage team: [nsbeta3+]
Whiteboard: [nsbeta3+]
Priority: P3 → P2
Whiteboard: [nsbeta3+] → [nsbeta3+][medium?]
Whiteboard: [nsbeta3+][medium?] → [nsbeta3+][medium]
I'm handing this off to Paul Chen 'cause he knows the Mac stuff (and has recently implemented stuff that can help out here). I think what we need to do is cause the mime-type of the resulting file to be set to text/html. The easiest way to do this is to add a "string mimeType" parameter to nsIStreamTransfer::SelectFileAndTransferLocationSpec. The implementation of this method would then have #ifdef MAC/#endif code that set the mime-type. All the callers of this method would have to be changed to pass in either the real mimetype, or, an empty string. There may be some complications in some cases. E.g., when doing "Save Link As..." from the context menu, we don't know the mime-type; we should probably guess it in that case from the file/url "extension." Another example is "Save Image As..."; I'm not sure we remember the real image mime-type (but maybe we can just infer one from the extension again). Paul, let me know if you need help hacking the stream transfer or unknown content type handler code.
Assignee: law → pchen
PDT thinks this is a P3 since there's an obvious workaround. We think it might be a P2 to fix the saving side so that .html is prefilled for the user, which doesn't happen today.
Priority: P2 → P3
Whiteboard: [nsbeta3+][medium] → [nsbeta3+][medium][PDTP3]
Status: NEW → ASSIGNED
This looks like a dupe of bug 44627 (or bug 44627 is a dupe of this one)
Whiteboard: [nsbeta3+][medium][PDTP3] → [nsbeta3-][medium][PDTP3][cut 0919]
nav triage team: edgecase, so nsbeta3- at this point in this schedule
nav triage team: Annoying, but not a beta1 stopper, marking nsbeta1-
Keywords: nsbeta1-
*** Bug 63970 has been marked as a duplicate of this bug. ***
Keywords: nsbeta3helpwanted
Whiteboard: [nsbeta3-][medium][PDTP3][cut 0919] → [medium][PDTP3][cut 0919]
*** Bug 64703 has been marked as a duplicate of this bug. ***
So how do we set a MIME type on the file from its file type?
Marking nsbeta1- bugs as future to get off the radar
Target Milestone: --- → Future
This is a pretty serious bug for Mac users, who are used to saving files without file extensions. It will also break composer users who do the same.
Keywords: mozilla0.9
Documents should only be displayed as HTML if there is some identifying metainformation associated with the file that indicates that it is HTML. Examples of such metainformation would be the ".html" filename extension, a type of "HTML" under Classic, or whatever the new mechanism is under OS X. If it's just a plain text file, Mozilla should display it as such. If you can somehow associate the text/html MIME type with the file, then that's great, and the way to go.
spam: over to File Handling. i have not changed the assigned developer [or the other fields for that matter], so if anyone realizes that a bug should have a more appropriate owner, go ahead and change it. :)
Component: XP Apps → File Handling
Removing adequated PDT grafitti.
Whiteboard: [medium][PDTP3][cut 0919]
->default owner
Assignee: pchen → law
Status: ASSIGNED → NEW
Target Milestone: Future → ---
Reassigning to Adam. I think the fix has to be implemented in nsWebProwserPersist; it should set the Mac type/creator appropriately for known mime types (html at a minimum).
There isn't traditionally a Mac file type for HTML, so, without the file extension, the only thing we can do is to sniff the contents of the file. 4.x does this, I believe.
restoring target milestone I'm not sure why extensionless files open as html on windows but not Mac. I thought the mac filetype/creator fields influenced that.
Target Milestone: --- → Future
Blocks: 154057
QA Contact: sairuh → petersen
Isn't the problem here just that IC is coming back with a type for us when we ask it for one?
When you single click on a file which has got an extension unknown to mozilla (like, RAR, MSI and so on) it is also displayed as plain text. When you press right mouse button, and Save As, you are default saving the file with .txt as extension. This could be very annoing. P.S. I use mozilla 1.4RC2 on windows 2000 and XP
Cristan Meijer: That is not true. I assume you are refering to http urls, in which case it depends entirely on the mime type the server sends to mozilla.
Is this a problem with current builds?
Not really, from what I've seen with Jaguar and Moz 1.4. While the file has no icon, and can't be double clicked or dragged onto mozilla in the dock, if one drags it directly into Mozilla's window, it does display as HTML now.
OS: Mac System 8.6 → MacOS X
OK. Well, I don't think I should be resolving bugs I can't test worksforme, so some mac person should take the initiative there, if needed.
worksforme with 2004020305 Mac SeaMonkey build on 10.3
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
This is certainly still a problem with current Camino and Firefox builds; a file with type TEXT and no extension is loaded, but it is rendered as raw plain text rather than HTML. Reopening. Can we do extra sniffing on these extensionless, type TEXT *local* files and then say they are text/html (rather than saying *all* files of type TEXT are html files, which is how I read comment 2)? Safari handles this as Mac users expect (as did 4.x), and it's a common complaint against Firefox and Camino made by many Mac users thinking of switching from Safari. Apparently people still *create* these types of files in 2007 (not just load old ones)!
Status: RESOLVED → REOPENED
Keywords: 4xp
Resolution: WORKSFORME → ---
Summary: html files saved without .html extension are viewed as plain text. → [Mac] html files saved without .html extension are viewed as plain text
Whiteboard: p-safari
I should add, I know this didn't work properly in 2004--I had looked at this very report before Asa closed it--which is why I'm reopening this bug rather than filing a new one.
Assignee: law → nobody
Status: REOPENED → NEW
QA Contact: chrispetersen → file-handling
So here's the thing. Right now, what we do for such files in nsFileChannel is call GetTypeFromFile on the helper app service. GetTypeFromFile calls nsInternetConfigService::GetMIMEInfoFromTypeCreator, which goes into Mac-specific code that I don't really know. Someone who understands how that stuff (e.g. Internet Config) is supposed to work should trace through it and see what's up.
Product: Core → Firefox
Target Milestone: Future → ---
Version: Trunk → unspecified
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.