【发布时间】:2018-11-12 14:45:32
【问题描述】:
我目前正在开发 Angular PWA,但由于某种原因,display="standalone" 设置似乎不适用于 Android 上的 Chrome。我的设置如下:
index.html
<!-- Manifest /PWA -->
<link rel="manifest" href="manifest.json">
<meta name="msapplication-config" content="/assets/browserconfig.xml">
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png">
<link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#003865">
<meta name="apple-mobile-web-app-title" content="">
<meta name="application-name" content="">
<meta name="msapplication-TileColor" content="#003865">
<meta name="theme-color" content="#003865">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-wep-app-capable" content="yes">
manifest.json
{
"name": "",
"short_name": "",
"description": "",
"icons": [{
"src": "assets/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "assets/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
}, {
"src": "assets/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
}, {
"src": "assets/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/assets/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/assets/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}],
"start_url": "index.html",
"display": "standalone",
"background_color": "#003865",
"theme_color": "#003865"
}
我似乎不明白为什么会这样,因为在 Safari 和三星 Internet 中一切正常。有人可以帮我找出问题所在吗?
干杯!
编辑:我忘了提到我已经在 Chrome 中使用了 LightHouse 工具,它为 PWA 返回了 100% 的分数,所以我想这不是问题。
【问题讨论】:
-
您是否在控制台中遇到任何错误...与清单相关?
-
在桌面浏览器的控制台中根本没有出现任何错误,除了这个特定问题之外,一切正常。
-
你能在 Chrome 开发者工具的应用标签下看到你的清单吗?
-
是的,我可以看到清单文件!
-
您的图片尺寸是否与指定的宽度相符?
标签: html angular progressive-web-apps manifest.json