Baseline 最新发布

了解最近已纳入 Baseline 新发布的功能。

借助定期后台同步,您可以在启动渐进式 Web 应用或由服务工作器支持的页面时显示新鲜内容。它会在应用或网页未使用时在后台下载数据。 安装服务工件后,请使用 Permissions API 查询 periodic-background-sync 。您可以通过窗口或 Service Worker 上下文执行此操作。 注册定期同步需要同时提供标记和最小同步间隔 ( minInterval )。标记用于标识已注册的同步,以便注册多个同步。在以下示例中,标记名称为 'content-sync' ,

  • HTML
  • CSS
  • JavaScript

Cecilia Cong

2024年12月21日

应用快捷方式可帮助用户快速启动 Web 应用中的常用或推荐任务。从显示应用图标的任何位置轻松访问这些任务,有助于提高用户的工作效率,并提升他们与 Web 应用的互动度。 如需调用应用快捷方式菜单,请在用户桌面上的任务栏 (Windows) 或底栏 (macOS) 中右键点击应用图标,或在 Android 设备上轻触并按住应用的启动器图标。 系统仅针对已安装的 渐进式 Web 应用 显示应用快捷方式菜单。如需了解可安装性要求,请参阅 了解 PWA 模块中的 安装 部分。

  • HTML
  • JavaScript

Francois Beaufort

2024年11月18日

有关默认体验,请参见以下示例,该示例未提供足够的背景信息。 如需获取“Richer Install”界面对话框,而不是常规的小型默认提示,请将 screenshots 和 description 字段添加到您的 Web 清单中。请查看下面的 Squoosh.app 示例: “Richer Install”界面对话框由 Web 清单中 description 和 screenshots 字段的内容组成。

  • HTML
  • JavaScript

Adriana Jara

2024年8月14日

Badges are used to convey non-urgent information to the user. For example, they are used to indicate the status of an app, or the number of unread items. The classic way of creating an app badge is to add a number to the favicon. On modern browsers,

  • JavaScript
  • HTML
  • CSS

Thomas Steiner

2025年2月27日

Sometimes you want to let users of your app select one of their contacts to message via an email or chat application, or help them discover which of their contacts have already joined a social platform. To get contacts from the address book, you need

  • JavaScript
  • HTML
  • CSS

Thomas Steiner

2025年2月27日

To make sure your browser supports the getScreenDetails() method, first check if it exists on the window object. Then, call window.getScreenDetails() to get attached screens. Adding an event listener to adapt to changed screen details allows you to

  • JavaScript
  • HTML
  • CSS

Palances Liao

2025年2月27日

Letting the user share the website they are on is a common web apps pattern that you can find on many news sites, blogs, or shopping sites. Since linking is one of the web's super powers, the hope is to acquire traffic from users who see the shared

  • JavaScript
  • HTML
  • CSS

Thomas Steiner

2025年2月27日