iOS PWA 在覆盖窗口而不是同一基本窗口中打开同域链接
我创建了一个渐进式网络应用程序,它不是单页应用程序,但具有页面重新加载的常规链接。
我添加了一个manifest.json,如下所示:
{
"name": "MyApp",
"short_name": "MyApp",
"theme_color": "#4FD083",
"background_color": "#333333",
"display": "fullscreen",
"lang": "de-DE",
"scope": "my_domain.tld",
"start_url": "my_domain.tld",
"icons": [
/* Some icons */
]
}
当我在iOS Safari中访问该页面并将其添加到主屏幕时,第一次打开它时它没有页眉和页脚栏(这是正确的) 。但是,一旦我单击“应用程序”中的任何链接,它就会在覆盖窗口中打开该链接的内容,该窗口有一个“完成”按钮和顶部的一些图标(这是不正确的)。看起来像这样:
我希望同一域上的所有链接(我希望由 manifest.json 中的范围属性定义)在同一个“窗口”中打开,尊重“全屏”或者manifest.json 中“display”属性的“standalone”值。
我也尝试过使用这些元标记,但无济于事:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
它在 Android (Chrome) 上按预期工作。
我做错了什么吗?
I've created a progressive web app which is no single page application, but has regular links with page reloads.
I've added a manifest.json which looks like this:
{
"name": "MyApp",
"short_name": "MyApp",
"theme_color": "#4FD083",
"background_color": "#333333",
"display": "fullscreen",
"lang": "de-DE",
"scope": "my_domain.tld",
"start_url": "my_domain.tld",
"icons": [
/* Some icons */
]
}
When I visit the page in iOS Safari and add it to the home screen, the first time I open it it doesn't have a header and footer bar (which is correct). But once I click any link within the "app", it opens the content of this link in an overlay window which has a "Done" button and some icons on top (which is not correct). Looks like this:
I want all links on the same domain (which I would expect is defined by the scope attribute in manifest.json) to open in the same "window", respecting the "fullscreen" or "standalone" value of the "display" attribute in manifest.json.
I also tried playing around with these meta tags, but to no avail:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
It works as expected on Android (Chrome).
Am I doing anything wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我成功了。我基本上做了三件事,但不确定其中哪一个起作用:
manifest.json
webServiceWorker #1
webServiceWorker #2(实际的)文件(如上所述)
元标记
希望这对遇到此问题的其他人有所帮助。
I got it working. I basically did three things, but am not certain which of it does the trick:
manifest.json
webServiceWorker #1
webServiceWorker #2 (the actual file as referenced above)
meta tags
Hope this will be helpful for anyone else running into this issue.