Firefox 41 release notes for developers
To test the latest developer features of Firefox, install Firefox Developer Edition Firefox 41 was released on September 22, 2015. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.
In this article
Changes for Web developers
>Developer Tools
Highlights:
- Take a screenshot of a DOM node
- Copy as HAR/save as HAR
- "Add Rule" button in the Rules view
- View source in a tab (Disabled by default)
- More options to copy CSS rules
- Copy image as data: URL in the Rules view
- Added command toGCLI to display CSP info
All devtools bugs fixed between Firefox 40 and Firefox 41: note that many of these bugs, especially those relating to the performance tools, were uplifted to Firefox 40.
CSS
Support for laying out vertical scripts has been activated by default (Firefox bug 1138384). That means that the following CSS properties are now available:
- Choosing the direction of writing:
writing-mode. - Controlling orientation of characters:
text-orientation. - Direction-independent equivalents of
widthandheight:block-sizeandinline-size. - Direction-independent equivalents of
min-widthandmin-height:min-block-sizeandmin-inline-size. - Direction-independent equivalents of
max-widthandmax-height:max-block-sizeandmax-block-size. - Direction-independent equivalents of
margin-top,margin-right,margin-bottomandmargin-left:margin-block-start,margin-block-end,margin-inline-startandmargin-inline-end. - Direction-independent equivalents of
padding-top,padding-right,padding-bottomandpadding-left:padding-block-start,padding-block-end,padding-inline-startandpadding-inline-end. - Direction-independent equivalents of
border-top,border-right,border-bottomandborder-leftand their longhands for width, style and color:border-block-start,border-block-start-width,border-block-start-style,border-block-start-color,border-block-end,border-block-end-width,border-block-end-style,border-block-end-color,border-inline-start,border-inline-start-width,border-inline-start-style,border-inline-start-color,border-inline-end,border-inline-end-width,border-inline-end-styleandborder-inline-end-color. - Direction-independent equivalents of
top,right,bottomandleft:offset-block-start,offset-block-end,offset-inline-startandoffset-inline-end.
- Choosing the direction of writing:
Support the
transform-originproperty in SVG and implement thetransform-boxproperty (Firefox bug 923193).
HTML
<a>without anhrefattribute is no longer classified as interactive content. Clicking it inside<label>will activate labelled content (Firefox bug 1167816).- SVG icons are now supported for site icons, that is favicons and shortcut icons (Firefox bug 366324).
- The
crossoriginattribute is now supported for<link rel='preconnect'> (Firefox bug 1174152). - The picture element does not react to resize/viewport changes (Firefox bug 1135812).
JavaScript
Date.prototypeis now an ordinary object, not aDateinstance anymore (Firefox bug 861219).Date.prototype.toStringis now a generic method (Firefox bug 861219).Symbol.specieshas been added (Firefox bug 1131043).Map[Symbol.species]andSet[Symbol.species]getters have been added (Firefox bug 1131043).- Non-standardlet expressions support has been dropped (Firefox bug 1023609).
- Destructured parameters with default value assignment are now supported (Firefox bug 1018628).
- Per ES2015, curly braces are required formethod definitions. Syntax without them will fail from now on (Firefox bug 1150855).
- Method definitions (except for generator methods) are not constructable anymore (Firefox bug 1059908 andFirefox bug 1166950).
- As part of ES2015 specification compliance, parenthesizeddestructuring patterns, like
([a, b]) = [1, 2]or({a, b}) = { a: 1, b: 2 }, are now considered invalid and will throw aSyntaxError. SeeJeff Walden's blog post for more details. - The
new.targetsyntax has been added (Firefox bug 1141865).
Interfaces/APIs/DOM
HTML Editing API
- Cut, copy and paste commands handling has been revamped and now allow programmatic copying and cutting from JS for Web content:
- With the
'paste'command as argument,Document.queryCommandSupported()now returnsfalseif has insufficient privileges to actually perform the action (Firefox bug 1161721). - With the
'cut'or'copy'command as argument,Document.queryCommandSupported()now returnstrueif called within the context of a user-initiated or privileged code (Firefox bug 1162952). - With the
'cut'or'copy'command as argument,Document.execCommand()now works, but only within the context of user-initiated or privileged code (Firefox bug 1012662). - Instead of raising an exception,
Document.execCommand()when the command is not supported or enabled (Firefox bug 1027560).
- With the
Events
- The non-standard
initCloseEvent()method of theCloseEventevent and the ability to create aCloseEventusing thedocument.createEvent('CloseEvent')method has been removed; use the standard constructor,CloseEvent()instead (Firefox bug 1161950). - On Desktop,
PointerEventis now activated by default in Nightly; it is not activated in Developer Edition, Beta or Release and won't be for at least some versions (Firefox bug 1166347). - The unprefixed version of
MouseEvent.movementXandMouseEvent.movementYhave been added; the prefixed versions are deprecated and will be removed at some point in the future (Firefox bug 1164981).
Web Crypto
SubtleCrypto.importKey()andSubtleCrypto.exportKey()now supportsECDHkeys (Firefox bug 1050175).
Canvas API
HTMLCanvasElement.captureStream()andCanvasCaptureMediaStreamhave been added and allow to stream the display of a<canvas>in real-time (Firefox bug 1032848).MediaStream.idnow returns the unique id of a stream (Firefox bug 1089798).- The initial value of
CanvasRenderingContext2D.filteris now correctly set tonone(Firefox bug 1163124).
Service Workers
Improvement to our experimentalService Worker implementation:
ServiceWorkerGlobalScope.skipWaiting()has been implemented (Firefox bug 1131352).Clients.claim()has been added (Firefox bug 1130684).- The other functional events of Service Workers have been made to inherit from
ExtendableEvent, giving them access to thewaitUntil()method (Firefox bug 1160527).
The
CacheStorageandCacheinterfaces are now supported (Firefox bug 1110144).
WebGL
- The
failIfMajorPerformanceCaveatWebGL context attribute has been added and can be set when creating a WebGL context withHTMLCanvasElement.getContext()to indicate if a context creation should fail if the system performance is low (Firefox bug 1164970).
WebRTC
- Firefox no longer offers a default STUN server to be used if none are specified when constructing a new
RTCPeerConnection. You'll need to provide one in order to successfully establish a WebRTC connection.
Miscellaneous
- On OS X and Windows,
Navigator.onLinenow changes regarding network connectivity (it always returnedtrue, unless "Work offline" mode was selected) before (Firefox bug 654579). MessagePortandMessageChannelnow available inWeb workers, and are enabled by default in all contexts (Firefox bug 952139) and (Firefox bug 911972).- The User Timing API is now available inWeb workers (Firefox bug 1155761).
- TheNotifications API is now available inWeb workers (Firefox bug 916893).
DOMRequestandDOMCursorare now available inWeb workers (Firefox bug 1167650).- TheCSS Font Loading API has been completely implemented and is now enabled by default (Firefox bug 1149381).
- Shared workers can no longer be shared between private (i.e., browsing in a private window) and non-private documents (seeFirefox bug 1177621).
- The
URL.searchParamsproperty is now read-only (Firefox bug 1174731). - The
HTMLAnchorElement.hashproperty no longer decodes URL fragment (Firefox bug 1093611).
MathML
New default and fallback font handling
Mathematical formulas require special fonts. So far, these fonts were hard-coded in themathml.css user agent stylesheet (which sets the font-family on<math> tag) and in the preference optionfont.mathfont-family (which sets the fallback fonts to use for stretchy and large operators). Firefox 41 introduces an internalx-math language that is automatically set on the<math> tag as well as corresponding preference options (e.g.,font.name.serif.x-math). The user agent stylesheet now sets font-family to serif on the<math> tag and the preference optionfont.mathfont-family is replaced withfont.name.serif.x-math. All platforms now essentially use the same list of fallback fonts, with "Latin Modern Math" as the first one. The default/fallback fonts can be configured from the standard per-language font preference menu. For more details, seeFirefox bug 947654 andFirefox bug 1160456.
SVG
- Site icons (favicons, shortcut icons) now support SVG (Firefox bug 366324).
Audio/Video
- The
media.autoplay.enabledpreference now also applies to untrustedHTMLMediaElement.play()invocations too, that is calls from non-users activated scripts (Firefox bug 659285).
Networking
- The
X-Content-Durationheader is no longer supported (Firefox bug 1160695). - Draft versions of the HTTP/2 protocol are no more supported (Firefox bug 1132357).
Security
- TheCSP 1.1
manifest-srcdirective is now supported (Firefox bug 1089255). - Previous versions of Firefox incorrectly expected theContent Security Policy referrer directive's value
origin-when-cross-originto be spelledorigin-when-crossorigin. This has been corrected to include the missing dash character.
Changes for add-on and Mozilla developers
>XUL
No change.
JavaScript code modules
No change.
XPCOM
>Interfaces
No change.
Other
- A new, internal, and chrome-context-only API to render the root widget of a window into a
<canvas>has been added:CanvasRenderingContext2D.drawWidgetAsOnScreen(). This API uses the operating system to snapshot the widget on-screen. For more details seeFirefox bug 1167477.