Chrome 75 Beta 发布,Web 共享功能支持共享文件

  

Chrome 75 Beta 目前已在 Android, Chrome OS, Linux, macOS 和 Windows 上提供(版本号 Chrome 75.0.3770.18),作为首个测试版,除了对性能和稳定性的改进,更重要的是带来了不少新功能。

Chrome 75 beta 通过引入新的动画构造函数、Web 动画 API 和低延迟的 canvas 上下文以更好地控制动画的创建。在改进 Web RTC 方面,对 FIDO CTAP2 PIN 的支持已被添加到 Web Authentication API,Service workers 支持显示在Chrome 的任务管理工具上。

还有一个值得关注的新功能,因为 Web Share API 中新增对文件的支持,所以 Web 共享功能现在可以共享文件。示例代码:

if (navigator.canShare && navigator.canShare({ files: filesArray })) {
  navigator.share({
    files: filesArray,
    title: 'Vacation Pictures',
    text: 'Barb\nHere are the pictures from our vacation.\n\nJoe',  })
  .then(() => console.log('Share was successful.'))
  .catch((error) => console.log('Sharing failed', error));
} else {
  console.log('Your systems doesn't support sharing files.');
}

如上所述,新功能带来了新方法和新的 shareData 属性,详细内容请查看 Share files with Web Share

至于此前提到的默认启用延迟加载功能,目前暂未看到官方对其的介绍,后续保持关注。

猜你喜欢

转载自www.oschina.net/news/106486/chrome-75-beta-low-latency-canvas
今日推荐