简体   繁体   English

iOS PWA “添加到主屏幕” - 禁用全屏模式

[英]iOS PWA “Add to Home Screen” - DISABLE Full Screen Mode

I have a PWA that is cross-platform but am running into some issues on iOS 11.3+.我有一个跨平台的 PWA,但在 iOS 11.3+ 上遇到了一些问题。

When a user executes "Add to Homescreen" I would like to KEEP the menu bar (refresh, back, forward buttons).当用户执行“添加到主屏幕”时,我想保留菜单栏(刷新、后退、前进按钮)。 ie I don't want full-screen mode because I don't want to have to create my own refresh and back buttons.即我不想要全屏模式,因为我不想创建自己的刷新和返回按钮。

I've followed the advice at https://medium.com/@firt/dont-use-ios-web-app-meta-tag-irresponsibly-in-your-progressive-web-apps-85d70f4438cb .我遵循了https://medium.com/@firt/dont-use-ios-web-app-meta-tag-irresponsively-in-your-progressive-web-apps-85d70f4438cb 上的建议。 Most other articles I've found are significantly out-of-date on the subject.我发现的大多数其他文章在这个主题上都已经过时了。

I've removed the "apple-mobile-web-app-capable" meta tag but it doesn't work.我已经删除了“apple-mobile-web-app-capable”元标记,但它不起作用。 I've also tried setting the value to "no".我也尝试将值设置为“否”。

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

How do I PREVENT the "Add to Homescreen" on iOS 11 from going to into full-screen mode?如何防止 iOS 11 上的“添加到主屏幕”进入全屏模式?

Just remove the meta tag itself:只需删除元标记本身:

Make sure you also are removing the apple-mobile-web-app-status-bar-style meta tag also otherwise it may be thinking that you want it in full-screen mode by stating you want the status bar.确保您还删除了 apple-mobile-web-app-status-bar-style 元标记,否则它可能会认为您希望它处于全屏模式,说明您想要状态栏。

If you are still having problems after this and clearing all your history and cache, check out Apple's article on PWAs and try to remove the extra meta tags that are inserted in your website.如果在此之后您仍然遇到问题并清除所有历史记录和缓存,请查看Apple 关于 PWA 的文章并尝试删除插入您网站的额外元标记。

If you find that your PWA still remains full-screen after removing:如果您发现您的 PWA 在移除后仍然保持全屏状态:

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

Double-check your manifest.json for "display": "standalone" and remove it also.仔细检查您的manifest.json中的"display": "standalone"并将其删除。

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

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