在 Android Firefox 上添加到主屏幕不会屏蔽图标 [英] Adding to home screen on Android Firefox does not mask icon

查看:79
本文介绍了在 Android Firefox 上添加到主屏幕不会屏蔽图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

网络应用清单上的

在我的清单中,我提供大小为 192x192 和 512x512 的图标;Firefox 确实从清单中获取了其中一个图标;它只是没有执行所需的屏蔽:

<代码>{"background_color": "#00bf00",描述": "...","display": "独立",图标":[{"src": "plug-192.png",尺寸":192x192","type": "图像/png",目的":任何可屏蔽"},{"src": "plug-512.png",尺寸":512x512","type": "图像/png",目的":任何可屏蔽"}],名称": "...",简称": "...","start_url": "/"}

如果我安装"应用程序,而不仅仅是通过汉堡菜单将其添加到主屏幕"(这次使用不同的图标,进一步使用透明度),情况会稍微好一些,但 Firefox 版本仍然看起来很差(像素化并使用与 Chrome 不同的透明度约定),参见.下面的屏幕截图(左侧为 Chrome已安装的网络应用",右侧为 Firefox):

所以我的问题就变成了:

<块引用>

有什么方法可以强制 Android Firefox 生成类似于 Chrome(以及典型的 Android 应用程序)生成的结果?

解决方案

当前的 Firefox 发行版不支持可屏蔽图标.它适用于 Firefox Beta 版,一旦该版本进入稳定版,即可使用.

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?

解决方案

The current Firefox release version doesn't support maskable icons. It works in Firefox Beta and will work once that version makes its way to the stable channel.

这篇关于在 Android Firefox 上添加到主屏幕不会屏蔽图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆