【发布时间】:2018-01-13 12:59:15
【问题描述】:
我只是在构建一个静态 HTML 页面,我想让它可以安装。
manifest.json
{
"name": "YYY",
"short_name": "YYY",
"icons": [
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"start_url":"index.html"
}
index.html
<head>
<link rel="apple-touch-icon" sizes="180x180" href="https://xxx.png">
<link rel="icon" type="imageits-not-the-real-one/png" href="https://xxx.png"
sizes="32x32">
<link rel="icon" type="imageits-not-the-real-one/png" href="https://xxx.png"
sizes="16x16">
<link rel="manifest" href="https://my-manifest-its-not-the-real-one.json">
..
项目结构
错误
清单:属性“start_url”被忽略,应该与文档同源。
【问题讨论】:
-
等等!您是否将其链接为
https://manifest.json? -
不,当然是假的。
-
您是否尝试在 URL 中使用
/,例如/index.html? -
是的。它没有工作:(
-
您是在本地服务器上工作还是仅仅使用
file:///访问您PC 上的HTML 文档?
标签: javascript html json progressive-web-apps manifest.json