Chrome 61 Beta:JavaScript 模块,桌面端的支付请求 API,Web Share API 和 WebUSB

原文来自 Chrome 官方博客:Chrome 61 Beta: JavaScript modules, Payment Request API on desktop, Web Share API, and WebUSB
译者: @justjavacjavascript

除非另有说明,不然下述更改适用于 Android,Chrome OS,Linux,Mac 和 Windows 的最新 Chrome Beta 版本。css

JavaScript 模块(Modules)

Modules 容许开发人员声明脚本的依赖关系,这在第三方构建工具中已经很受欢迎,第三方构建工具使用它们用来只打包须要的脚本。此版本经过新的 <script type=module> 元素添加对
JavaScript 模块的原生支持。html

原生支持意味着浏览器能够并行获取精细的依赖关系,利用缓存来避免整个页面中的重复,并确保脚本按照正确的顺序执行,而无需构建步骤。前端

进一步阅读, learn more about JavaScript modulesthe aspects of the JavaScript language affected by modules.java

用于桌面环境的付款请求 API(Payment Request API)

Payment Request API 如今可用于 Windows,Mac,Linux 和 ChromeOS,去年已经支持了 Android 平台。开发人员如今能够跨平台提供安全、无缝的结账体验。android

进一步阅读,integration guidegit

The PaymentRequest process throughout a transaction.

Web Share API

为了让用户轻松地在社交网络上分享内容,开发人员不得不为每一个社交服务手动将分享按钮集成到他们的网站中。这一般致使用户没法方便的使用订制的分享服务,而那些包含第三方代码的页面无形中增长了代码大小和安全风险。es6

网站如今能够在 Chrome for Android 上使用新的 navigator.share API 来触发本机
Android 共享对话框,容许用户轻松地与任何已安装的本机应用程序共享文本或连接。在未来的版本中,此 API 也能够分享到已安装的 Web 应用程序。github

The navigator.share API allows the user to share content with a variety of native apps via the native Android share dialog.

WebUSB

大多数硬件外设(如键盘、鼠标、打印机和游戏手柄)均受到高级 Web 平台 API 的支持。要使用专业的教育、科学或工业 USB 外设,用户必须找到并安装具备系统级权限的潜在不安全的驱动程序和软件。web

Chrome 如今支持 WebUSB API,容许网络应用程序与用户受权的外设进行通讯。这使得这些设备提供的全部功能都能保持网络的安全性。

此版本中的其余功能

  • The Network Information API is now available on desktop as well as Android, enabling sites to access the underlying connection information of a device.

  • Developers can now specify scrolling smoothness via a new optional parameter in existing Scroll APIs or with the scroll-behavior CSS property.

  • The CSSOM View Smooth Scroll API brings native smooth scrolling to the platform through a the scroll-behavior: smooth CSS property or by using the window.scrollTo() DOM scroll method, eliminating the need to implement this behavior with JavaScript

  • CSS color values can now be 8- and 4-digit hex colors of the format #RRGGBBAA and #RGBA.

  • Sites can now access the relative positions of the screen content with the Visual Viewport API, exposing complex functionality like pinch-and-zoom in a more direct way.

  • The Device RAM API is now available, exposing the amount of RAM on a user’s device to sites to optimize overall performance of a web application.

  • When navigating from an installed web app to a site outside the initial web app’s scope, the new site now automatically loads in a Custom Chrome Tab.

  • ...


欢迎关注个人公众号,关注前端文章:

justjavac微信公众号

相关文章
相关标签/搜索