【发布时间】:2018-06-30 16:34:54
【问题描述】:
我有 manifest.json,并使用 <link rel="manifest" href="./manifest.json"> 添加到我的 HTML。
我认为一切都很好,但我不明白为什么 chrome 开发工具无法检测到我的清单!
我的 manifest.json:
{
"name": "Arman News",
"short_name": "Ar News",
"description": "This is my first try to make PWA webstie.",
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"Scope": "/",
"start_url": ".",
"icons": [
{
"src": "img/icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"splash_pages": null
}
【问题讨论】:
-
尝试将路径中的点放到
href="/manifest.json" -
@LGSon 我之前试过 :(
-
尝试将
Scope替换为scope。我认为它区分大小写。 -
好吧,路径中不应该是一个点,所以请确保没有,而且清单的文件扩展名实际上应该是
.webmanifest(尽管有些浏览器支持其他浏览器作为好吧),所以也尝试一下,像这样<link rel="manifest" href="/manifest.webmanifest">...并确保实际文件也被重命名,并且存储在wwwroot文件夹中。跨度>
标签: javascript google-chrome-devtools manifest pwa