参见英文答案 > How to get Add to Home Screen Pop up on Site Open in mobile browser 4个
有没有人知道任何例子,我如何在chrome中显示“添加到主屏幕”的弹出消息.
在我的网络应用程序中,我想显示弹出消息第一次用户打开Web应用程序以保存快捷方式图标.使用html5和jquery. (这样我的webapp将在下次作为本机应用程序运行).
最佳答案
自Chrome 42以来,现在有一种标准的accomplishing this方式,只要您的Web应用程序满足以下要求,就会提示用户将您的应用程序添加到主屏幕:
原文链接:https://www.f2er.com/jquery/428765.html
- You have a web app manifest file
- The manifest defines how your app appears on the user’s system and how it should be launched – and you are required to have a
short_name
and a144x144
png icon- Your icon declarations should include a mime type of image/png
- You have a service worker registered on your site. We recommend a simple custom offline page service worker
- Your site is served over HTTPS (you need a service worker after all)
- The user has visited your site twice over two separate days during the course of two weeks.