---
title: Firefox 41 for developers
slug: Mozilla/Firefox/Releases/41
tags:
- Firefox
- Firefox 41
translation_of: Mozilla/Firefox/Releases/41
---
{{FirefoxSidebar}}
Changes for Web developers
开发工具
Highlights:
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 ({{bug(1138384)}}). That means that the following CSS properties are now available:
- Choosing the direction of writing: {{cssxref("writing-mode")}}.
- Controlling orientation of characters: {{cssxref("text-orientation")}}.
- Direction-independent equivalents of {{cssxref("width")}} and {{cssxref("height")}}: {{cssxref("block-size")}} and {{cssxref("inline-size")}}.
- Direction-independent equivalents of {{cssxref("min-width")}} and {{cssxref("min-height")}}: {{cssxref("min-block-size")}} and {{cssxref("min-inline-size")}}.
- Direction-independent equivalents of {{cssxref("max-width")}} and {{cssxref("max-height")}}: {{cssxref("max-block-size")}} and {{cssxref("max-block-size")}}.
- Direction-independent equivalents of {{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-bottom")}} and {{cssxref("margin-left")}}: {{cssxref("margin-block-start")}}, {{cssxref("margin-block-end")}}, {{cssxref("margin-inline-start")}} and {{cssxref("margin-inline-end")}}.
- Direction-independent equivalents of {{cssxref("padding-top")}}, {{cssxref("padding-right")}}, {{cssxref("padding-bottom")}} and {{cssxref("padding-left")}}: {{cssxref("padding-block-start")}}, {{cssxref("padding-block-end")}}, {{cssxref("padding-inline-start")}} and {{cssxref("padding-inline-end")}}.
- Direction-independent equivalents of {{cssxref("border-top")}}, {{cssxref("border-right")}}, {{cssxref("border-bottom")}} and {{cssxref("border-left")}} and their longhands for width, style and color: {{cssxref("border-block-start")}}, {{cssxref("border-block-start-width")}}, {{cssxref("border-block-start-style")}}, {{cssxref("border-block-start-color")}}, {{cssxref("border-block-end")}}, {{cssxref("border-block-end-width")}}, {{cssxref("border-block-end-style")}}, {{cssxref("border-block-end-color")}}, {{cssxref("border-inline-start")}}, {{cssxref("border-inline-start-width")}}, {{cssxref("border-inline-start-style")}}, {{cssxref("border-inline-start-color")}}, {{cssxref("border-inline-end")}}, {{cssxref("border-inline-end-width")}}, {{cssxref("border-inline-end-style")}} and {{cssxref("border-inline-end-color")}}.
- Direction-independent equivalents of {{cssxref("top")}}, {{cssxref("right")}}, {{cssxref("bottom")}} and {{cssxref("left")}}: {{cssxref("offset-block-start")}}, {{cssxref("offset-block-end")}}, {{cssxref("offset-inline-start")}} and {{cssxref("offset-inline-end")}}.
- Support the {{cssxref("transform-origin")}} property in SVG and implement the {{cssxref("transform-box")}} property ({{bug(923193)}}).
HTML
- {{HTMLElement("a")}} 没有
href
属性,并且不再被分类为交互内容. 点击 {{HTMLElement("label")}} 将会激活标签内容({{bug(1167816)}}).
- SVG 图标现在支持站点图标(偏爱图标和快捷方式图标)({{bug(366324)}}).
- The {{htmlattrxref('crossorigin', 'link')}} attribute is now supported for <link rel='preconnect'> ({{bug(1174152)}}).
- The picture element does not react to resize/viewport changes ({{bug(1135812)}}).
JavaScript
- {{jsxref("Date.prototype")}}现在是一个普通对象, 不再是一个 {{jsxref("Date")}} 实例 ({{bug(861219)}}).
- {{jsxref("Date.prototype.toString")}} 现在是一般方法({{bug(861219)}}).
- {{jsxref("Symbol.species")}}被增加到({{bug(1131043)}}).
- {{jsxref("Map.@@species", "Map[@@species]")}} 和{{jsxref("Set.@@species", "Set[@@species]")}} 获取已经被增加 ({{bug(1131043)}}).
- 非标准 {{jsxref("Statements/let", "let expression", "#let_expressions", 1)}} 支持已经被废弃({{bug(1023609)}}).
- {{jsxref("Functions/Default_parameters", "Destructured parameters with default value assignment","#Destructured_parameter_with_default_value_assignment", 1)}} 现在已经被支持 ({{bug(1018628)}}).
- Per ES2015, 方法定义 需要尖括号. 从现在开始语法没有尖括号将会失败({{bug(1150855)}}).
- 方法定义 (除了生成方法) 已经不再可构造 ({{bug(1059908)}} 和{{bug(1166950)}}).
- As part of ES2015 specification compliance, parenthesized destructuring patterns, like
([a, b]) = [1, 2]
or ({a, b}) = { a: 1, b: 2 }
, are now considered invalid and will throw a {{jsxref("SyntaxError")}}. See Jeff Walden's blog post for more details.
- The
new.target
syntax has been added ({{bug(1141865)}}).
Interfaces/APIs/DOM
- 剪切、复制和粘贴命令处理已经被重新编码,并且现在允许JS编程实现网页内容复制和剪切。
- 使用
'paste'
名利作为参数, {{domxref("Document.queryCommandSupported()")}}现在会返回false如果不充分的权限被执行({{bug(1161721)}}).
- 使用
'cut'
或 'copy'
命令作为参数, {{domxref("Document.queryCommandSupported()")}} 现在返回true
如果调用的上下文中包括用户发起的或特权代码({{bug(1162952)}}).
- 使用
'cut'
或'copy' 命令作为参数
, {{domxref("Document.execCommand()")}} 将会执行, 但是仅仅在用户发起的或特权代码的上下文下({{bug(1012662)}}).
Events
- 非标准的{{domxref("CloseEvent.initCloseEvent()")}} 方法和创建 {{domxref("CloseEvent")}} 使用 {{domxref("Event.createEvent", "Event.createEvent('CloseEvent')")}} 方法已经被移除. 相反可以使用标准的构造器{{domxref("CloseEvent.CloseEvent", "CloseEvent()")}} . ({{bug(1161950)}}).
- On Desktop, {{domxref("PointerEvent")}} is 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 ({{bug(1166347)}}).
- The unprefixed version of {{domxref("MouseEvent.movementX")}} and {{domxref("MouseEvent.movementY")}}}} have been added; the prefixed versions are deprecated and will be removed at some point in the future ({{bug(1164981)}}).
Web Crypto
- {{domxref("SubtleCrypto.importKey()")}} 和{{domxref("SubtleCrypto.exportKey()")}} 现在支持
ECDH
keys ({{bug(1050175)}}).
Canvas API
- {{domxref("HTMLCanvasElement.captureStream()")}} and {{domxref("CanvasCaptureMediaStream")}} have been added and allow to stream the display of a {{HTMLElement("canvas")}} in real-time ({{bug(1032848)}}).
- {{domxref("MediaStream.id")}} now returns the unique id of a stream ({{bug(1089798)}}).
- The initial value of {{domxref("CanvasRenderingContext2D.filter")}} is now correctly set to
none
({{bug(1163124)}}).
Service Workers
- Improvement to our experimental Service Worker implementation:
- {{domxref("ServiceWorkerGlobalScope.skipWaiting()")}} has been implemented ({{bug(1131352)}}).
- {{domxref("Clients.claim()")}} has been added ({{bug(1130684)}}).
- The other functional events of Service Workers have been made to inherit from {{domxref("ExtendableEvent")}}, giving them access to the {{domxref("ExtendableEvent.waitUntil","waitUntil()")}} method ({{bug("1160527")}}).
- The {{domxref("CacheStorage")}} and {{domxref("Cache")}} interfaces are now supported ({{bug("1110144")}}).
WebGL
- The
failIfMajorPerformanceCaveat
WebGL context attribute has been added and can be set when creating a WebGL context with {{domxref("HTMLCanvasElement.getContext()")}} to indicate if a context creation should fail if the system performance is low ({{bug(1164970)}}).
WebRTC
- Firefox no longer offers a default STUN server to be used if none are specified when constructing a new {{domxref("RTCPeerConnection")}}. You'll need to provide one in order to successfully establish a WebRTC connection.
Miscellaneous
MathML
新的默认、支持字体处理
数学公式需要特殊的字体. 到目前为止, 这些字体被硬编码在用户默认样式 mathml.css
(使用{{MathMLElement("math")}} 标志设置字体组) 和偏好选项font.mathfont-family
(为拉伸和大操作数设置支持字体). Firefox 41 引入一个能够自动设置<math>标志和相应偏好选项的内置x-math
语言 (例如font.name.serif.x-math
). 用户默认样式现在将<math>标志字体设置为serif 并且font.mathfont-family
被替换为 font.name.serif.x-math
. 所有平台现在基本使用相同列表的支持字体, "Latin Modern Math" 是首选.在标准的 per-language字体偏好菜单中,默认支持字体能够被设置. 更多细节,请参照{{bug(947654)}} 和 {{bug(1160456)}}.
SVG
- 站点图片(偏爱图标,快捷方式图标) 现在支持SVG({{bug(366324)}})
音频/视频
- The
media.autoplay.enabled
preference now also apply to untrusted {{domxref("HTMLMediaElement.play()")}} invocations too, that is calls from non-users activated scripts ({{bug(659285)}}).
Networking
- The
X-Content-Duration
header is no longer supported ({{Bug(1160695)}}).
- Draft versions of the HTTP/2 protocol are no more supported ({{bug(1132357)}}).
Security
- The CSP 1.1
manifest-src
directive 已经被支持 ({{bug(1089255)}}).
- Previous versions of Firefox incorrectly expected the Content Security Policy referrerdirective's value
origin-when-cross-origin
to be spelled origin-when-crossorigin
. This has been corrected to include the missing dash character.
Changes for add-on and Mozilla developers
XUL
没有变化。
JavaScript code modules
没有变化。
XPCOM
没有变化。
其他
- A new, internal, and chrome-context-only API to render the root widget of a window into a {{HTMLElement("canvas")}} has been added: {{domxref("CanvasRenderingContext2D.drawWidgetAsOnScreen()")}}. This API uses the operating system to snapshot the widget on-screen. For more details see {{bug(1167477)}}.
See also
之前版本
{{Firefox_for_developers('40')}}