酷勤网 – 程序员的那点事!
当前位置:首页 > 资讯 > 软件测评 > 浏览器 > 正文

Chrome 50 Beta: 推送通知改进和声明式预加载

浏览次数: 谷歌开发者社区(GDG)英文链接 2016年03月28日 字号:
如果没有特别说明,下面的内容适用于所有 Android, Chrome OS, Linux, Mac 和 Windows 平台上最新 ChromeBeta

推送通知改进

Web 推送通知允许网站发送系统级的通知,就像原生应用的效果一样。最初的实现是依靠 service worker 主动从服务器上获取通知信息的。这种方式的问题是,在飞行中或者当设备处于不稳定的网络连接时会收到多条消息。现在最新版的 Chrome 允许网站在推送消息中包含通知的数据负载(data payloads)以消除最后的服务检查。为了保护用户隐私,推送通知的数据负载必须加密推送通知的数据负载推送 API 规范的一部分,并且已被 Firefox 支持。 除了数据负载,现在网站可以检测到通知何时被用户关闭,这样能够更好地分析以及允许跨设备解除通知。网站还可以更精细地控制通知的外观,设置通知动作的自定义时间戳和图标。在更新通知时,网站可以指定设备是否使用声音或震动来提醒用户,或是保持沉默。 在 Chrome 50 中,通知动作支持自定义图标 在 Chrome 50 中,通知动作支持自定义图标  

声明式预加载

有时页面需要加载某些资源后才能完全显示出来,但这些资源要在 Chrome 加载完其它资源之后才会加载。例如一个大的 JavaScript 文件可能会请求另一个特定的样式文件,但是直到 Chrome 执行了这个 JavaScript 后才知道要加载这个 CSS 文件。Chrome现在支持<link rel=’preload’>属性,它允许开发者指定应当被优先下载的资源,并减少在用户面前获得有意义内容的时间。 使用了 preload 特性的 Chrome 50(左) vs 没使用的 Chrome 49(右)

此版本中的其它特性

  1. HTMLMediaElement.play()now returns a promise, allowingsites to react more easily if automatic playback fails.
  2. Sites can process the image stored in a canvas elementas a blob fileusingHTMLCanvasElement.toBlob().
  3. Chrome supports the creation ofImageBitmapobjects, which can bequickly and asynchronously written to a canvas element.
  4. Absolute device orientationcan be accessed via AbsoluteDeviceOrientation while DeviceOrientation nowreturns relative valuesthat don’t use the magnetometer, preventing drift caused by nearby metallic objects when tracking head motion in VR.
  5. TheDOMTokenListsupported tokensfeature nowenables developers to detect sandbox optionsor link relations on elements.
  6. TheFormDataobject, which allows programmatic creation of web form data, nowallows sites to inspect and modify data in addition to writing values.
  7. Developers can now use the ES2015Unicode regex flag u, as well as theregex well-known symbols@@match, @@replace, @@search, and @@split, for better control over regular expression matching.
  8. Sites can now buffer audio and video streams without gapsusing theSourceBuffer.modeattribute and the‘sequence’option.
  9. Presentation connections can bemanaged more robustlywith PresentationConnectionCloseEvent and PresentationConnectionCloseReason instead of the deprecated PresentationConnection.onStateChange.
  10. Sites can nowcontrol the first focus targetwhen the user presses tab or shift-tab while nothing is focused.
  11. To improveWeb Animationspec compliance,Cancel eventsandAnimation.idare now supported,pause()uses a pause state instead of idle, and dashed-names as keys in keyframes have been deprecated.
  12. Parameter automation ofWeb AudioBiquadFilter nodesis now evaluated every sample frame, rather than once every 128 frames, making resonant filter sweeps smoother.
  13. Chrome no longer supports TLS version fallbacks, which allowed attackers toforce all sites to use an older version of TLS.

较小的变化

  1. Chrome now supports theX25519 curvefor TLS, allowing faster, simpler encryption.
  2. -webkit-background-compositehas been removed since it was nonstandard and had low usage.
  3. The SVGZoomEvent, which was a no-op in Chrome, has been deprecated to improvespeccompliance.
  4. TheRTCPeerConnectionmethods createOffer() and createAnswer() have been deprecated to enable promise-based implementations.
  5. <link rel=’subresource’> has been deprecated in favor of <link rel=’preload’>, as described above.
  6. XMLHTTPRequestProgressEvent has been removed in favor of ProgressEvent to improve spec compliance.
  7. TheDocument.defaultCharsetattribute has been removed to improve spec compliance.
  8. KeyboardEvent.prototype.keyLocation has been removed in favor of KeyboardEvent.prototype.location, which is supported across more browsers.
  9. The SVGElement.offset* methods have been removed from all elements except HTMLElement to improvespeccompliance.
作者:Peter Beverloo 和Nicolás Satragno,通知骑士。
翻译:Guokai Han
无觅相关文章插件,快速提升流量 齐乐娱乐