清单 theme/background-color
Manifest theme/background-color
在我的 manifest.json 文件中,我设置了主题颜色和背景颜色
{
"name": "Friends",
"short_name": "Friends",
"icons": [
{
"src": "/src/images/icons/friends-b-icon-48x48.png",
"type": "image/png",
"sizes": "48x48"
},
{
"src": "/src/images/icons/friends-b-icon-144x144.png",
"type": "image/png",
"sizes": "144x144"
},
{
"src": "/src/images/icons/friends-b-icon-256x256.png",
"type": "image/png",
"sizes": "256x256"
},
{
"src": "/src/images/icons/friends-b-icon-512x512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "/index.html",
"scope": ".",
"display": "standalone",
"orientation": "portrait-primary",
"background-color": "#795548",
"theme-color": "#795548",
"description": "Share your moments with your friends",
"dir": "ltr",
"lang": "en-US"
}
但是当我查看时 Chrome 它们都不见了
有谁知道如何解决这个问题?
提前致谢!
在 manifest.json
中,属性名称使用 _
作为分隔符,而不是 -
。
您必须将 background-color
更改为 background_color
,将 theme-color
更改为 theme_color
。
在我的 manifest.json 文件中,我设置了主题颜色和背景颜色
{
"name": "Friends",
"short_name": "Friends",
"icons": [
{
"src": "/src/images/icons/friends-b-icon-48x48.png",
"type": "image/png",
"sizes": "48x48"
},
{
"src": "/src/images/icons/friends-b-icon-144x144.png",
"type": "image/png",
"sizes": "144x144"
},
{
"src": "/src/images/icons/friends-b-icon-256x256.png",
"type": "image/png",
"sizes": "256x256"
},
{
"src": "/src/images/icons/friends-b-icon-512x512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "/index.html",
"scope": ".",
"display": "standalone",
"orientation": "portrait-primary",
"background-color": "#795548",
"theme-color": "#795548",
"description": "Share your moments with your friends",
"dir": "ltr",
"lang": "en-US"
}
但是当我查看时 Chrome 它们都不见了
有谁知道如何解决这个问题? 提前致谢!
在 manifest.json
中,属性名称使用 _
作为分隔符,而不是 -
。
您必须将 background-color
更改为 background_color
,将 theme-color
更改为 theme_color
。