Affecting <script> with version parameter will no longer be loaded

Published: | Categories: HTML, JavaScript

Description

Traditionally, Firefox has required an explicit version parameter for the <script> element’s type attribute to use the advanced features of JavaScript 1.7 and 1.8.

<script type="application/javascript;version=1.7"></script>
<script type="application/javascript;version=1.8"></script>

Starting with Firefox 44, the let statement no longer requires an explicit JavaScript version. Meanwhile, the support for destructuring for-in, legacy iterators, legacy generators, array comprehensions and expression closures added with JavaScript 1.7 and 1.8 has been removed in favour of the standard alternatives.

As part of the standardization efforts, the support for the Firefox-specific JavaScript version parameter has also been removed with Firefox 59. It means <script> with any version parameter will no longer be loaded because those will be treated as scripts of an unknown MIME type like text/template. According to Mozilla’s telemetry, this change may affect 0.02% of script loading.

If you are serving JavaScript, you can simply omit the type attribute which is optional in HTML5 as well as the newer HTML Living Standard, or you should be using one of the standard JavaScript MIME types including text/javascript and application/javascript without any parameters.

References