This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12217 - Suggestion: Allow other 'Content-Type's to result from javascript: scheme URI dereferencing
Summary: Suggestion: Allow other 'Content-Type's to result from javascript: scheme URI...
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
Depends on:
Reported: 2011-03-02 04:56 UTC by Luis
Modified: 2011-08-04 05:16 UTC (History)
8 users (show)

See Also:


Description Luis 2011-03-02 04:56:59 UTC
Currently, dereferencing a javascript: scheme URI treats its script evaluation result as the body of an HTTP response with Content-Type 'text/html'. Navigation then uses Media Type Sniffing to adjust this Content-Type and dispatch corresponding processing.
According to 'Media Type Sniffing', the sniffed content type is either 'text/html', 'application/rss+xml', or 'application/atom+xml'. This precludes processing for other media types (eg, other XML media types like 'application/xhtml+xml' or 'image/svg+xml') a javascript: URI could generate.

I propose allowing the script result to explicitly specify the HTTP 'Content-Type' entity header as if it were a partial HTTP response lacking a start-line. Eg, evaluating the script could result in a string like this:
Content-Type: <media-type>

The user-agent could supply a function to facilitate writing these correctly (inserting field-names, colons, and carriage return linefeed sequences; cleaning the content; etc). I invite the reader to consider other options if this one is unsatisfactory.
Comment 1 Adam Barth 2011-03-03 07:27:04 UTC
I doubt WebKit would implement this behavior.  Please use data URLs instead.  JavaScript URLs exist only to service legacy content.
Comment 2 Ian 'Hixie' Hickson 2011-05-06 00:22:25 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:

Status: Rejected
Change Description: no spec change
Rationale: see comment 1. This is just legacy behaviour.
Comment 3 Michael[tm] Smith 2011-08-04 05:16:31 UTC
mass-move component to LC1