文章
如何创建应用快捷方式
应用快捷方式可帮助用户快速启动 Web 应用中的常用或推荐任务。从显示应用图标的任何位置轻松访问这些任务,有助于提高用户的工作效率,并提升他们与 Web 应用的互动度。 如需调用应用快捷方式菜单,请在用户桌面上的任务栏 (Windows) 或底栏 (macOS) 中右键点击应用图标,或在 Android 设备上轻触并按住应用的启动器图标。 系统仅针对已安装的 渐进式 Web 应用 显示应用快捷方式菜单。如需了解可安装性要求,请参阅 了解 PWA 模块中的 安装 部分。
如何添加更丰富的安装界面
有关默认体验,请参见以下示例,该示例未提供足够的背景信息。 如需获取“Richer Install”界面对话框,而不是常规的小型默认提示,请将 screenshots 和 description 字段添加到您的 Web 清单中。请查看下面的 Squoosh.app 示例: “Richer Install”界面对话框由 Web 清单中 description 和 screenshots 字段的内容组成。
How to periodically synchronize data in the background
Periodic background sync lets you show fresh content when a progressive web app or service worker-backed page is launched. It does this by downloading data in the background when the app or page is not being used. After the service worker is
How to create an app badge
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,
How to use multiple screens
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
How to access contacts from the address book
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
How to let the user share the website they are on
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