Bug 23096 - version in type attribute of type "application/javascript" should be supported
Summary: version in type attribute of type "application/javascript" should be supported
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P4 Normal
Assignee: Nobody
URL:
Keywords: InRadar, NeedsReduction
Depends on:
Blocks:
 
Reported: 2009-01-04 06:05 PST by Georg Maaß
Modified: 2022-07-21 17:13 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Maaß 2009-01-04 06:05:37 PST
Specifying the version in type attribute of type "application/javascript" should be supported. Actually a script with version extension in the type attribute is not executed.

This should be supported:

<script language="javascript1.6" type="application/javascript;version=1.6">

This is already supported:
<script language="javascript1.6" type="application/javascript">


Also the version specification should be used to switch ON/OFF language specific features like new key words as introduced in JavaScript 1.7 or implementation variants like the Array constructor of JavaScript 1.2.
Comment 1 Mark Rowe (bdash) 2009-01-05 19:10:20 PST
<rdar://problem/6474778>
Comment 2 Ahmad Saleem 2022-07-21 13:09:56 PDT
According to the IETF's ECMAScript Media Types Updates as of May 2022, the RFC-4329 is obsolete.

Link - https://datatracker.ietf.org/doc/rfc9239/

StackOverflow - https://stackoverflow.com/questions/876561/when-serving-javascript-files-is-it-better-to-use-the-application-javascript-or

********

The media type registrations herein are divided into two major
   categories: (1) the sole media type "text/javascript", which is now
   in common usage and (2) all of the media types that are obsolete
   (i.e., "application/ecmascript", "application/javascript",
   "application/x-ecmascript", "application/x-javascript", "text/
   ecmascript", "text/javascript1.0", "text/javascript1.1", "text/
   javascript1.2", "text/javascript1.3", "text/javascript1.4", "text/
   javascript1.5", "text/jscript", "text/livescript", and "text/
   x-ecmascript").

********

I am not sure whether Safari currently support "application/javascript" as of right now but I think based on latest standard, there is no need to add old attribute support.

Can this be marked accordingly? Thanks!
Comment 3 Ryosuke Niwa 2022-07-21 17:13:24 PDT
Yeah, this works per HTML5 spec:
https://mimesniff.spec.whatwg.org/#javascript-mime-type