Adding to home screen on Android Firefox does not mask icon

萝らか妹 提交于 2020-03-26 04:04:30

问题


The Google documentation on web app manifests specifies that in order to make web app icons mask properly, an icon should be marked as "purpose": "any maskable". This works well on Chrome on Android but the mask fails to mask as expected when using "Add to home screen" in Firefox Android (Android 10, Firefox Mobile 68.5.0).

In my manifest, I'm providing icons of sizes 192x192 and 512x512; Firefox does indeed take one of the icons from the manifest; it's just not performing the desired masking:

{
  "background_color": "#00bf00",
  "description": "...",
  "display": "standalone",
  "icons": [
     {
      "src": "plug-192.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any maskable"
    },
    {
      "src": "plug-512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any maskable"
    }
  ],
  "name": "...",
  "short_name": "...",
  "start_url": "/"
}

If I "install" the app, rather than just "add it to home screen" through the hamburger menu (and this time with a different icon that furthermore uses transparency), the situation is slightly better, but the Firefox version still looks rather poor (being pixelated and using a different convention for transparency than Chrome), cf. the screenshot below (Chrome "installed web app" on the left, Firefox on the right):

So my question simply becomes:

Is there any way to coerce Android Firefox into producing a result something that looks like what Chrome (and indeed, typical Android apps) produces?

来源:https://stackoverflow.com/questions/60485013/adding-to-home-screen-on-android-firefox-does-not-mask-icon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!