我已经找到了解决这个问题的方法。
即使添加了 apple-touch-fullscreen 元标记,iPadOS 也会向 Web 应用程序添加 URL 栏,但现在使用与渐进式 Web 应用程序 (PWA) 一起使用的 manifest.json 文件来检测全屏模式。在 iOS 13 版本之前已经支持此功能,但直到现在才需要全屏体验。
在我的应用程序中,manifest.json 链接标记<link rel="manifest" href="manifest.json">
仅在检测到 Google Chrome 时添加;更新它以在检测到 iPad 上的 Safari 时添加链接导致灰色条完全隐藏(请注意,iPad 检测在此版本中已更改,现在可以请求移动/桌面版本)
允许全屏的manifest.js文件如下所示(显示:“standalone”允许全屏)
{
"name": "MyApp",
"short_name": "MyApp",
"description": "MyApp description",
"version": "0.0.0.1",
"manifest_version": 2,
"default_locale": "en-GB",
"author": "Christopher Dean",
"start_url": "Home.aspx",
"display": "standalone",
"orientation": "landscape",
"theme_color": "#015174",
"background_color": "#F7F4F3",
"icons": [
{
"src": "images/app-icon-chrome.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "images/app-icon-tiny.png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "images/app-icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "images/app-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"app": {
"urls": [
"http://MyApp/Home.aspx"
],
"launch": {
"web_url": "http://MyApp/"
},
"background": {
"scripts": [ "chrome.js" ]
},
"permissions": [
"unlimitedStorage",
"notifications",
"fullscreen"
]
}
}