【问题标题】:Is there any way to detect if a user has added a web app to their home screen?有什么方法可以检测用户是否在他们的主屏幕上添加了 Web 应用程序?
【发布时间】:2014-04-17 16:27:33
【问题描述】:

我在网站上使用 iOS 跳板“添加到主屏幕”通知,该通知会根据某些用户信息显示。如果用户已经将网络应用添加到他们的主屏幕,我只是不想触发我的弹出窗口。

有什么方法可以检测到这个吗?

【问题讨论】:

    标签: javascript ios web-applications detection


    【解决方案1】:

    您应该能够查看是全屏还是在浏览器中使用

    if (navigator.standalone) {
        alert ('Running full screen');
    } else {
        alert ('Running in a browser');
    }
    

    或者另一种方法是查看窗口大小,看看周围是否有铬。

    【讨论】:

      猜你喜欢
      • 2021-01-11
      • 2015-04-29
      • 2016-03-20
      • 2011-04-17
      • 1970-01-01
      • 2011-10-24
      • 2017-10-01
      • 2013-02-14
      • 1970-01-01
      相关资源
      最近更新 更多