google-chrome - Chrome 开发者工具中的 “App banner support”

标签 google-chrome google-chrome-devtools progressive-web-apps progressive-enhancement

Chrome Canary 55 中渐进式网络应用安装的“应用横幅支持”设置在哪里?

this guide ,我想测试网络应用安装横幅在我的网站上是否正常工作。
本文展示了使用 Chrome 开发工具移动面板进行测试的可能性...

enter image description here

以下是他的说明:

If you don’t see the “Request app banner…” entry, try the following:

  • Update Chrome to the latest version
  • Enable the flag for “Devtools Experiments” chrome flags enable-devtools-experiments and restart Chrome
  • Enable the option “App banner support” in Devtools -> Settings -> Experiments (If you don’t see it, press Shift six times there to get all experiments)
  • Enable the flag for “Add to shelf” chrome://flags/#enable-add-to-shelf

因此,我启用了标志,打开开发工具,按 Shift x6,但我在这里没有看到任何有关“应用横幅支持”的内容。

最佳答案

您提到的教程相对过时,该功能已被移动并从 DevTools 实验中毕业。

Chrome 53/55 DevTools 有一个应用程序 选项卡,其中包含添加到主屏幕 链接,如果您的应用符合下面概述的条件(错误记录到控制台):

Application tab in Chrome DevTools

Chrome 53/55、macOS Sierra 上的安装横幅屏幕截图: Chrome screenshot on macOS

Chrome 54、Android 6.0.1 上的安装横幅屏幕截图: enter image description here

More recent (updated 6-Oct-2016) documentation on Web App Install Banners状态:

Chrome automatically displays the banner when your app meets the following criteria:

  • Has a web app manifest file with:
    • a short_name (used on the home screen)
    • a name (used in the banner)
    • a 144x144 png icon (the icon declarations must include a mime type of image/png)
    • a start_url that loads
  • Has a service worker registered on your site.
  • Is served over HTTPS (a requirement for using service worker).
  • Is visited at least twice, with at least five minutes between visits.

Testing the app install banner

The app install banner is only shown after the user visits the page at least twice within five minutes. You can disable the visit-frequency check by enabling the Chrome flag #bypass-app-banner-engagement-checks. To test on desktop Chrome, you need to enable the Chrome flag #enable-add-to-shelf.

Then, as long as you have a manifest (configured correctly), are on HTTPS (or localhost) and have a service worker, you should see the install prompt.

关于google-chrome - Chrome 开发者工具中的 “App banner support”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39905347/

相关文章:

google-chrome - 在 Chrome 和 Firefox 中使用换行符对 textarea 进行不同的 maxlength 验证

javascript - 如何通过 Headless Chrome Runtime.evaluate 在终端中获取 console.log 输出

javascript - Chrome 开发工具 : view all event listeners used in the page

javascript - 渐进式网络应用程序未捕获( promise )TypeError : Failed to fetch

google-chrome - HTTP 103 早期提示 : How to diagnose if they are correctly set by Cloudflare and respected by Chrome?

css - "overflow: hidden;"被 PC 上的 Chrome 忽略

google-chrome - 在 Chrome 开发者工具中调试时跳过行

javascript - 在 Chrome 开发者工具中检查 Javascript Hover

android - Chrome DevTools 远程调试不显示连接的移动设备的 chrome 版本

javascript - 有没有办法在 PWA 中缓存多个文件?