cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

在"浏览器预览"时,会收到 Chrome 的 apple-mobile-web-app-capable 弃用警告

Open puxiao opened this issue 1 year ago • 0 comments

Cocos Creator version

3.8.4

System information

Window11

Issue description

预览栏 > 浏览器预览 > Chrome 控制台查看该警告:

<meta name="apple-mobile-web-app-capable" content="yes"> is deprecated. Please include <meta name="mobile-web-app-capable" content="yes">

我查询了一下资料:

  • Safari 支持 apple-mobile-web-app-capable 但 Chrome 不支持

  • Chrome 建议使用 mobile-web-app-capable

    也有一些非官方网页讲 Safari 也支持 mobile-web-app-capable


该标签涉及到的文件有:

  • templates/fb-instant-games/index.ejs
  • templates/web-desktop/index.ejs
  • templates/web-mobile/index.ejs

解决方案1:直接使用 mobile-web-app-capable 替换 apple-mobile-web-app-capable

- <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="mobile-web-app-capable" content="yes">

2 个知名框架就是这样做的:

  • Flutter:https://github.com/flutter/flutter/pull/154964
  • Next.js:https://github.com/vercel/next.js/pull/70363

解决方案2:2个标签共存

简单来说就是把 2 个标签都定义一次:

+ <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes">

具体该怎么做,要不要直接采用 替换方式,需要衡量一下。

puxiao avatar Oct 21 '24 07:10 puxiao