javascript – 如何添加到’添加到主屏幕’弹出Android手机

前端之家收集整理的这篇文章主要介绍了javascript – 如何添加到’添加到主屏幕’弹出Android手机前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

参见英文答案 > 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应用程序满足以下要求,就会提示用户将您的应用程序添加到主屏幕:

  • 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 a 144x144 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.
原文链接:https://www.f2er.com/jquery/428765.html

猜你在找的jQuery相关文章