简体   繁体   English

为什么android chrome使用apple-touch-icon而不是清单中指定的内容添加到主屏幕?

[英]Why is android chrome add to homescreen using apple-touch-icon instead of what's specified in my manifest?

Here's my manifest.json: 这是我的manifest.json:

{
  "lang": "en",
  "name": "Complice",
  "short_name": "Complice",
  "icons": [
    {
      "src": "favicon-36x36.png",
      "sizes": "36x36",
      "type": "image/png",
      "density": "0.75"
    },
    {
      "src": "favicon-48x48.png",
      "sizes": "48x48",
      "type": "image/png",
      "density": "1.0"
    },
    {
      "src": "favicon-72x72.png",
      "sizes": "72x72",
      "type": "image/png",
      "density": "1.5"
    },
    {
      "src": "favicon-96x96.png",
      "sizes": "96x96",
      "type": "image/png",
      "density": "2.0"
    },
    {
      "src": "favicon-144x144.png",
      "sizes": "144x144",
      "type": "image/png",
      "density": "3.0"
    },
    {
      "src": "favicon-192x192.png",
      "sizes": "192x192",
      "type": "image/png",
      "density": "4.0"
    }
  ],
  "start_url": "/",
  "display": "standalone",
  "orientation": "portrait"
}

Turns out the answer was really silly. 原来答案确实很愚蠢。 I had 我有

<link rel="manifest" href="manifest.json">

but this link was only accurate on the homepage, not the main app page that you'd want to save a link to. 但是此链接仅在首页上正确,而在您要保存链接的主应用程序页面上不正确。 Changed it to this and it worked as expected: 更改为此,它按预期工作:

<link rel="manifest" href="/manifest.json">

I'm adding this question and answer because I got no results when I searched for my question, and I figured this might help future people. 我添加此问题和答案是因为搜索我的问题时没有结果,而且我认为这可能对将来的人们有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM