简体   繁体   English

Apple 将图标添加到仅在 Safari 中打开的主屏幕

[英]Apple add icon to home screen open in Safari only

I have created numerous resolutions of apple-touch-icon for my website.我为我的网站创建了许多apple-touch-icon分辨率。 This means when someone adds my website to their Apple device Home Screen it has that icon.这意味着当有人将我的网站添加到他们的 Apple 设备主屏幕时,它会显示该图标。 However when you click the icon it opens in a standalone window, rather than in the Safari browser.但是,当您单击该图标时,它会在独立窗口中打开,而不是在 Safari 浏览器中打开。

I have tried using <meta name="apple-mobile-web-app-capable" content="no"> but this doesn't seem to do anything.我尝试使用<meta name="apple-mobile-web-app-capable" content="no">但这似乎没有任何作用。

Is there a way of preventing this from happening and make the webpage open in Safari only?有没有办法防止这种情况发生并使网页仅在 Safari 中打开?

I think I found a way.我想我找到了方法。 Remove these lines from <head> section:<head>部分删除这些行:

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

And remove minimal-ui from:并从以下位置删除minimal-ui

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">

(if defined) (如果定义)

Here is the source: https://discussions.apple.com/thread/5967053?tstart=0这是来源: https : //discussions.apple.com/thread/5967053?tstart=0

If your app doesn't have that <meta> tags it should open directly inside Safari (at least mine does).如果你的应用没有那个<meta>标签,它应该直接在 Safari 中打开(至少我的有)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM