Bug 11641 - Wanted: option to render HTML sent with wrong mime type as HTML
Summary: Wanted: option to render HTML sent with wrong mime type as HTML
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Nobody
URL: http://relnotes.sb.ubi.com/index.shtml
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-17 21:19 PST by Richard Connamacher
Modified: 2006-11-18 00:46 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Connamacher 2006-11-17 21:19:10 PST
There are a few web sites that send HTML documents with the wrong mime type, most often text/plain. It usually happens if the document is dynamically generated or has a less common extension like shtml, and the author never tested it with a standards-based browser. This causes Safari (and any standards-based browser) to display the raw HTML code as plain text.

It'd be great if Safari offered an option, via a contextual menu, to render text/plain files as if they were text/html. The way it could work is this:

If a text/plain document appears to be HTML (such as, it starts with <html, <?xml, <!DOCTYPE, <head, or <body), display it as plain text and add an item to the document's contextual menu called "Render as HTML" which, if selected, would interpret it as if it were sent as text/html.

The reason for a contextual menu, and not an item on the Safari menubar, is that I think it should be available to any application that embeds Webkit -- like where I encountered this problem today.
Comment 1 Alexey Proskuryakov 2006-11-18 00:46:23 PST
All major browsers perform content sniffing to work with HTML sent as text/plain, and Safari does so, too. I'm surprised that this document is displayed as text.

However, our content sniffing is provided by a closed source system framework, so it's not in WebKit. Sorry for the hassle, but could you please re-file this bug via <http://bugreport.apple.com> for Apple engineers to take a look (free registration required)?.