Firefox 41 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.
Changes for Web developers
开发工具
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: URI in the Rules view
- Added command to GCLI 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
width
andheight
:block-size
andinline-size
. - Direction-independent equivalents of
min-width
andmin-height
:min-block-size
andmin-inline-size
. - Direction-independent equivalents of
max-width
andmax-height
:max-block-size
andmax-block-size
. - Direction-independent equivalents of
margin-top
,margin-right
,margin-bottom
andmargin-left
:margin-block-start
,margin-block-end
,margin-inline-start
andmargin-inline-end
. - Direction-independent equivalents of
padding-top
,padding-right
,padding-bottom
andpadding-left
:padding-block-start
,padding-block-end
,padding-inline-start
andpadding-inline-end
. - Direction-independent equivalents of
border-top
,border-right
,border-bottom
andborder-left
and 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-style
andborder-inline-end-color
. - Direction-independent equivalents of
top
,right
,bottom
andleft
:offset-block-start
,offset-block-end
,offset-inline-start
andoffset-inline-end
.
- Choosing the direction of writing:
-
Support the
transform-origin
property in SVG and implement thetransform-box
property (Firefox bug 923193).
HTML
<a>
没有href
属性,并且不再被分类为交互内容。点击<label>
将会激活标签内容 (Firefox bug 1167816).- SVG 图标现在支持站点图标 (偏爱图标和快捷方式图标)(Firefox bug 366324).
- The
crossorigin
attribute 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.prototype
现在是一个普通对象,不再是一个Date
实例 (Firefox bug 861219).Date.prototype.toString
现在是一般方法 (Firefox bug 861219).Symbol.species
被增加到 (Firefox bug 1131043).Map[@@species]
和Set[@@species]
获取已经被增加 (Firefox bug 1131043).- 非标准 let expression 支持已经被废弃 (Firefox bug 1023609).
- Destructured parameters with default value assignment 现在已经被支持 (Firefox bug 1018628).
- Per ES2015, 方法定义 需要尖括号。从现在开始语法没有尖括号将会失败 (Firefox bug 1150855).
- 方法定义 (除了生成方法) 已经不再可构造 (Firefox bug 1059908 和Firefox 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 aSyntaxError
. See Jeff Walden's blog post for more details. - The
new.target
syntax has been added (Firefox bug 1141865).
Interfaces/APIs/DOM
-
剪切、复制和粘贴命令处理已经被重新编码,并且现在允许 JS 编程实现网页内容复制和剪切。
- 使用
'paste'
名利作为参数,Document.queryCommandSupported()
现在会返回 false 如果不充分的权限被执行 (Firefox bug 1161721). - 使用
'cut'
或'copy'
命令作为参数,Document.queryCommandSupported()
现在返回true
如果调用的上下文中包括用户发起的或特权代码 (Firefox bug 1162952). - 使用
'cut'
或'copy'
命令作为参数,Document.execCommand()
将会执行,但是仅仅在用户发起的或特权代码的上下文下 (Firefox bug 1012662).
- 使用
Events
- 非标准的
CloseEvent.initCloseEvent()
方法和创建CloseEvent
使用Event.createEvent('CloseEvent')
方法已经被移除。相反可以使用标准的构造器CloseEvent()
. (Firefox bug 1161950). - On Desktop,
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 (Firefox bug 1166347). - The unprefixed version of
MouseEvent.movementX
andMouseEvent.movementY
have been added; the prefixed versions are deprecated and will be removed at some point in the future (Firefox bug 1164981).
Web Crypto
SubtleCrypto.importKey()
和SubtleCrypto.exportKey()
现在支持ECDH
keys (Firefox bug 1050175).
Canvas API
HTMLCanvasElement.captureStream()
andCanvasCaptureMediaStream
have been added and allow to stream the display of a<canvas>
in real-time (Firefox bug 1032848).MediaStream.id
now returns the unique id of a stream (Firefox bug 1089798).- The initial value of
CanvasRenderingContext2D.filter
is now correctly set tonone
(Firefox bug 1163124).
Service Workers
-
Improvement to our experimental Service 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
CacheStorage
andCache
interfaces are now supported (Firefox bug 1110144).
WebGL
- The
failIfMajorPerformanceCaveat
WebGL 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.onLine
now changes regarding network connectivity (it always returnedtrue
, , unless "Work offline" mode was selected) before (Firefox bug 654579). MessagePort
andMessageChannel
now available in Web workers, and are enabled by default in all contexts (Firefox bug 952139) and (Firefox bug 911972).- The User Timing API is now available in Web workers (Firefox bug 1155761).
- The Notifications API is now available in Web workers (Firefox bug 916893).
DOMRequest
andDOMCursor
are now available in Web workers (Firefox bug 1167650).- The CSS 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 (see Firefox bug 1177621).
- The
URLUtilsSearchParams.searchParams
property is now read-only (Firefox bug 1174731). - The
URLUtils.hash
property no longer decodes URL fragment (Firefox bug 1093611).
MathML
新的默认、支持字体处理
数学公式需要特殊的字体。到目前为止,这些字体被硬编码在用户默认样式 mathml.css
(使用<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 字体偏好菜单中,默认支持字体能够被设置。更多细节,请参照Firefox bug 947654 和 Firefox bug 1160456.
SVG
- 站点图片 (偏爱图标,快捷方式图标) 现在支持 SVG(Firefox bug 366324)
音频/视频
- The
media.autoplay.enabled
preference now also apply to untrustedHTMLMediaElement.play()
invocations too, that is calls from non-users activated scripts (Firefox bug 659285).
Networking
- The
X-Content-Duration
header is no longer supported (Firefox bug 1160695). - Draft versions of the HTTP/2 protocol are no more supported (Firefox bug 1132357).
Security
- The CSP 1.1
manifest-src
directive 已经被支持 (Firefox bug 1089255). - Previous versions of Firefox incorrectly expected the Content Security Policy referrerdirective's value
origin-when-cross-origin
to be spelledorigin-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
<canvas>
has been added:CanvasRenderingContext2D.drawWidgetAsOnScreen()
. This API uses the operating system to snapshot the widget on-screen. For more details see Firefox bug 1167477.
See also
更早期的版本
- Firefox 40 的开发者说明
- Firefox 39 的开发者说明
- Firefox 38 的开发者说明
- Firefox 37 的开发者说明
- Firefox 36 的开发者说明
- Firefox 35 的开发者说明
- Firefox 34 的开发者说明
- Firefox 33 的开发者说明
- Firefox 32 的开发者说明
- Firefox 31 的开发者说明
- Firefox 30 的开发者说明
- Firefox 29 的开发者说明
- Firefox 28 的开发者说明
- Firefox 27 的开发者说明
- Firefox 26 的开发者说明
- Firefox 25 的开发者说明
- Firefox 24 的开发者说明
- Firefox 23 的开发者说明
- Firefox 22 的开发者说明
- Firefox 21 的开发者说明
- Firefox 20 的开发者说明
- Firefox 19 的开发者说明
- Firefox 18 的开发者说明
- Firefox 17 的开发者说明
- Firefox 16 的开发者说明
- Firefox 15 的开发者说明
- Firefox 14 的开发者说明
- Firefox 13 的开发者说明
- Firefox 12 的开发者说明
- Firefox 11 的开发者说明
- Firefox 10 的开发者说明