如何检测 Safari 上的页面是否是从跳板打开的?

发布于 2024-08-22 07:01:23 字数 98 浏览 4 评论 0原文

我看过一次,但再也找不到了:

如何通过 JavaScript 检测 iPhone Web 应用程序是否是从 URL 键入或跳板中的图标打开的?

谢谢!

i saw it once and i cant find it again:

how to detect via JavaScript if an iphone webapp was opened from a url typing or from an icon in the springboard?

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何必那么矫情 2024-08-29 07:01:23

您可以检测页面是否以全屏模式打开。

if (window.navigator.standalone) {
  //
} else {
  //
}

从带有以下元标记的主屏幕图标启动的页面将以全屏模式打开。

<meta name="apple-mobile-web-app-capable" content="yes" />

You can detect if a page has been opened in full screen mode.

if (window.navigator.standalone) {
  //
} else {
  //
}

Pages launched from home screen icons with the following meta tag will open in full screen mode.

<meta name="apple-mobile-web-app-capable" content="yes" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文