Firefox 58 面向开发者的发布说明
本文提供有关 Firefox 58 中影响开发者的更改的信息。Firefox 58 于 2018 年 1 月 23 日发布。
面向网络开发者的变更
开发者工具
- 形状路径编辑器已默认启用,用于通过
clip-path生成的形状(Firefox bug 1405339)。 - 网络监视器现在有一个按钮,可以暂停/播放网络流量记录(Firefox bug 1005755)。
- 在网络监视器中,“Flash”筛选按钮不再可用,Flash 请求包含在“其他”筛选器中(Firefox bug 1413540)。
- 旧版响应式设计模式的代码(Firefox 52 之前默认启用)现已从 DevTools 中删除(Firefox bug 1305777)。有关新工具的信息,请参阅响应式设计模式。
- 从页面检查器的 CSS 面板查看 MDN 文档的选项已删除(Firefox bug 1382171)(自 55 版本以来已禁用,Firefox bug 1352801)。
HTML
无更改。
CSS
font-display描述符现在在所有平台上默认可用(Firefox bug 1317445)。
SVG
无更改。
JavaScript
Promise.prototype.finally()方法已实现(Firefox bug 1019116)。Intl.PluralRules对象已实现(Firefox bug 1403318)。Intl.NumberFormat.prototype.formatToParts()方法已实现(Firefox bug 1403319)。Intl.DateTimeFormat对象现在支持hourCycle选项和hc语言标签(Firefox bug 1386146)。- 可选 catch 绑定提案已实现(Firefox bug 1380881)。
API
新 API
PerformanceNavigationTimingAPI 已实现(Firefox bug 1263722)。- Gecko 还提供了一个偏好设置,如果需要,可用于禁用此接口 —
dom.enable_performance_navigation_timing,默认值为true(Firefox bug 1403926)。
- Gecko 还提供了一个偏好设置,如果需要,可用于禁用此接口 —
DOM
- 通过某些 API 中的错误对象报告的错误——例如,在
FileReader、IDBRequest和IDBTransaction的error属性中,以及通过RTCPeerConnection的某些方法发出的请求不成功时——现在由DOMException实例表示。DOMError现已弃用,已从 DOM4 规范中删除(Firefox bug 1120178)。 - 现在支持
PerformanceResourceTiming.workerStart属性(Firefox bug 1191943)。 - 已实现基于预算的后台超时限制 — 有关更多详细信息,请参阅辅助后台页面性能的策略(Firefox bug 1377766)。
DOM 事件
无更改。
媒体和 WebRTC
- 已删除
HTMLMediaElement.srcObject的带前缀版本;请确保代码已更新,使用标准srcObject而不是mozSrcObject(Firefox bug 1183495)。 - 现在,使用
MediaStream.addTrack()将轨道添加到通过getUserMedia()获取的流中,然后尝试录制生成的流,将按预期工作。以前,只有getUserMedia()返回的流中最初包含的轨道才会被包含在录制的媒体中(Firefox bug 1296531)。 - WebVTT
VTTRegion接口始终在解释 WebVTT 文件时创建,但之前并未利用生成的区域。从 Firefox 58 开始,如果您通过将media.webvtt.regions.enabled首选项的值设置为true来启用它,则它们将被利用。
Canvas 和 WebGL
- 已删除对带前缀的 WebGL 扩展的支持(Firefox bug 1403413)
- 对于
MOZ_WEBGL_compressed_texture_atc,请改用WEBGL_compressed_texture_atc。 - 对于
MOZ_WEBGL_compressed_texture_pvrtc,请改用WEBGL_compressed_texture_pvrtc。 - 对于
MOZ_WEBGL_compressed_texture_s3tc,请改用WEBGL_compressed_texture_s3tc。 - 对于
MOZ_WEBGL_depth_texture,请改用WEBGL_depth_texture。 - 对于
MOZ_WEBGL_lose_context,请改用WEBGL_lose_context。
- 对于
HTTP
frame-ancestors在Content-Security-Policy-Report-Only中不再被忽略(Firefox bug 1380755)。- Firefox 现在实现了一个 TLS 握手超时,默认值为 30 秒。可以通过编辑 about:config 中的
network.http.tls-handshake-timeout偏好设置来更改超时值(Firefox bug 1393691)。 worker-srcCSP 指令已实现(Firefox bug 1302667)。- 现在支持 425: Too Early 状态码和相关的
Early-Data请求头(Firefox bug 1406908)。
安全
无更改。
插件
无更改。
其他
- Firefox for Android 现在支持“添加到主屏幕”,这是 渐进式网络应用 工作的一部分(Firefox bug 1212648)。
- WebAssembly 现在具有分层编译器,提供加载时间优化(Firefox bug 1277562),以及新的流 API —
WebAssembly.compileStreaming()和WebAssembly.instantiateStreaming()(Firefox bug 1347644)。
Web 平台移除的内容
HTML
- 您不能再将
<a>元素嵌套在<map>元素中以创建热点区域 — 必须改用<area>元素(Firefox bug 1317937)。
CSS
-
以下专有的 Mozilla 系统度量伪类不再可用于 Web 内容(Firefox bug 1396066)
:-moz-system-metric(images-in-menus):-moz-system-metric(mac-graphite-theme):-moz-system-metric(scrollbar-end-backward):-moz-system-metric(scrollbar-end-forward):-moz-system-metric(scrollbar-start-backward):-moz-system-metric(scrollbar-start-forward):-moz-system-metric(scrollbar-thumb-proportional):-moz-system-metric(touch-enabled):-moz-system-metric(windows-default-theme)
-
以下专有的 Mozilla 媒体特性不再可用于 Web 内容(Firefox bug 1396066)
-moz-color-picker-available-moz-is-glyph-moz-mac-graphite-theme-moz-mac-yosemite-theme-moz-os-version-moz-overlay-scrollbars-moz-physical-home-button-moz-scrollbar-end-backward-moz-scrollbar-end-forward-moz-scrollbar-start-backward-moz-scrollbar-start-forward-moz-scrollbar-thumb-proportional-moz-swipe-animation-enabled-moz-windows-accent-color-in-titlebar-moz-windows-classic-moz-windows-compositor-moz-windows-default-theme-moz-windows-glass-moz-windows-theme
-
专有的 Mozilla
:-moz-styleeditor-transitioning伪类不再可用于 Web 内容(Firefox bug 1396099)。
JavaScript
- 非标准的
Date.prototype.toLocaleFormat()方法已被删除(Firefox bug 818634)。 - 非标准和已弃用的
Object.prototype.watch()和Object.prototype.unwatch()方法已被删除,不再有效(Firefox bug 638054)。请考虑改用setter 和 getter 或代理。 - 旧版迭代器协议、
StopIteration对象、旧版生成器函数和非标准的Function.prototype.isGenerator()方法已被删除。请改用 ES2015 迭代协议和符合标准的迭代器和生成器(Firefox bug 1083482、Firefox bug 1413867、Firefox bug 1119777)。 - 非标准的数组推导和生成器推导已被删除(Firefox bug 1414340)。
API
XMLHttpRequest.responseType属性的专有moz-blob和moz-chunked-text值已在 Firefox 58 中完全删除(Firefox bug 1397145、Firefox bug 1397151、Firefox bug 1120171)。- 控制 Abort API 功能公开的
dom.abortController.enabled和dom.abortController.fetch.enabled偏好设置现已删除,因为这些功能现在默认启用(Firefox bug 1402317)。 - 专有的
mozSrcObject属性已在 Firefox 58 中删除(Firefox bug 1183495)。请改用标准的HTMLMediaElement.srcObject属性。
SVG
无更改。
面向附加组件和 Mozilla 开发者的变更
WebExtensions
-
- 已实现 browserSettings.webNotificationsDisabled (bug 1364942)
-
- browsingData.localStorage 现在支持按主机删除 localStorage (bug 1388428)
-
pkcs11 API 用于管理安全设备 (Bug 1357391)
-
privacy
- 现在可以通过 firstPartyIsolate 切换第一方隔离 (bug 1409045)
- 现在可以通过 resistFingerprinting 切换 resist fingerprinting 偏好设置 (bug 1397611)
-
tabs
- 已实现
tabs.discard(Bug 1322485) - 已实现 Tab 的 isArticle, isInReaderMode 属性 (Bug 1381992)
- 已实现
toggleReaderMode()方法 (Bug 1381992) - 已实现 tabs.created 的 openInReaderMode 选项 (Bug 1408993)
- tabs.onUpdated 现在在进入/退出阅读模式时通知 (Bug 1402921)
- 已实现
-
theme
- 获取当前主题属性的
getCurrent()方法 (Bug 1349944) - onUpdated 方法用于接收 WebExtension 主题更新 (Bug 1349944)
- colors.bookmark_text 现在支持作为 colors.toolbar_text 的别名 (Bug 1412595)
- 已实现 colors.toolbar_top_separator, colors.toolbar_bottom_separator 和 colors.toolbar_vertical_separator (Bug 1347190)
- 获取当前主题属性的
-
webRequest
- webRequest.onBeforeRequest 现在包含一个“frameAncestors”参数