【问题标题】:Light House: Manifest's short_name will be truncated when displayed on homescreen灯塔:清单的短名称在主屏幕上显示时将被截断
【发布时间】:2023-04-08 15:36:01
【问题描述】:

我没有得到这个。我们需要在 react 项目中添加短名称。

使 Web App Manifest 中的 short_name 属性少于 12 个字符。

{ ... "short_name": "空气喇叭", ... }

【问题讨论】:

  • 我在一个甚至没有清单文件的网页上看到了同样的警告。

标签: reactjs lighthouse


【解决方案1】:

您需要将其添加到 public\manifest.json 文件中

{
  "short_name": "React App",
  "name": "Create React App Sample",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "192x192",
      "type": "image/png"
    }
  ],
  "start_url": "./index.html",
  "display": "standalone",
  "theme_color": "#000000",
  "background_color": "#ffffff"
}

https://developers.google.com/web/fundamentals/web-app-manifest/

【讨论】:

  • 实际上我正在使用 react。反应项目中没有头。
  • 啊,当然。对不起。你需要把它放在 public/manifest.json 中进行反应。
  • 先生,我实现了这个想法,但它不能正常工作
猜你喜欢
  • 1970-01-01
  • 2023-02-07
  • 1970-01-01
  • 2015-07-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-13
相关资源
最近更新 更多