cc彩球网登录 – 程序员的那点事!

当前位置: 首页 > 资讯 > 软件测评 > 浏览器 > 正文

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

浏览次数:次 【】 2016年03月28日 字号:

如果没有特别说明,下面的内容适用于所有 Android, Chrome OS, Linux, Mac 和 Windows 平台上最新 Chrome。

推送通知改进

Web 推送通知允许网站发送系统级的通知,就像原生应用的效果一样。最初的实现是依靠 service worker 主动从服务器上获取通知信息的。这种方式的问题是,在飞行中或者当设备处于不稳定的网络连接时会收到多条消息。现在最新版的 Chrome 允许网站在推送消息中包含通知的数据负载(data payloads)以消除最后的服务检查。为了保护用户隐私,推送通知的数据负载。是的一部分,并且已被 Firefox 支持。

除了数据负载,现在网站可以检测到通知何时,这样能够更好地分析以及允许跨设备解除通知。网站还可以更精细地控制通知的外观,设置通知动作的自定义时间戳和图标。在更新通知时,网站可以指定设备是否使用声音或震动来提醒用户,或是保持沉默。

在 Chrome 50 中,通知动作支持自定义图标

在 Chrome 50 中,通知动作支持自定义图标

 

声明式预加载

有时,但这些资源要在 Chrome 加载完其它资源之后才会加载。例如一个大的 JavaScript 文件可能会请求另一个特定的样式文件,但是直到 Chrome 执行了这个 JavaScript 后才知道要加载这个 CSS 文件。Chrome属性,它允许开发者,并减少在用户面前获得有意义内容的时间。

使用了 preload 特性的 Chrome 50(左) vs 没使用的 Chrome 49(右)

此版本中的其它特性

  • now returns a promise, allowing.
  • Sites can process the image stored in a canvas elementusing.
  • Chrome supports the creation ofobjects, which can be.
  • can be accessed via AbsoluteDeviceOrientation while DeviceOrientation nowthat don’t use the magnetometer, preventing drift caused by nearby metallic objects when tracking head motion in VR.
  • Thefeature nowor link relations on elements.
  • Theobject, which allows programmatic creation of web form data, now.
  • Developers can now use the ES2015, as well as the@@match, @@replace, @@search, and @@split, for better control over regular expression matching.
  • using theattribute and theoption.
  • Presentation connections can bewith PresentationConnectionCloseEvent and PresentationConnectionCloseReason instead of the deprecated PresentationConnection.onStateChange.
  • Sites can nowwhen the user presses tab or shift-tab while nothing is focused.
  • spec compliance,andare now supported,uses a pause state instead of idle, and dashed-names as keys in keyframes have been deprecated.
  • Parameter automation ofis now evaluated every sample frame, rather than once every 128 frames, making resonant filter sweeps smoother.
  • Chrome no longer supports TLS version fallbacks, which allowed attackers to.

较小的变化

  • Chrome now supports thefor TLS, allowing faster, simpler encryption.
  • has been removed since it was nonstandard and had low usage.
  • The SVGZoomEvent, which was a no-op in Chrome, has been deprecated to improvecompliance.
  • Themethods createOffer() and createAnswer() have been deprecated to enable promise-based implementations.
  • <link rel=’subresource’> has been deprecated in favor of <link rel=’preload’>, as described above.
  • XMLHTTPRequestProgressEvent has been removed in favor of ProgressEvent to improve spec compliance.
  • Theattribute has been removed to improve spec compliance.
  • KeyboardEvent.prototype.keyLocation has been removed in favor of KeyboardEvent.prototype.location, which is supported across more browsers.
  • The SVGElement.offset* methods have been removed from all elements except HTMLElement to improvecompliance.

作者:Peter Beverloo 和Nicolás Satragno,通知骑士。
翻译:Guokai Han