From 3e590b87cf0901f1e864e5e528d74690c7c5857a Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Sat, 21 Sep 2019 11:50:00 -0400 Subject: [PATCH] FEATURE: Add support for maskable icons in the PWA manifest Because: - Chrome 78 and Firefox Fenix have support for it - The icons will look better by using all the availiable space - Admins can control the icon and add appropriate padding since we have a dedicated asset for the manifest logo. Read more about it on https://css-tricks.com/maskable-icons-android-adaptive-icons-for-your-pwa/ This commit: - Adds a new key under the icons array in the webmanifest, named purpose with maskable value. --- app/controllers/metadata_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/metadata_controller.rb b/app/controllers/metadata_controller.rb index 189852afb1..51d1a1e1f8 100644 --- a/app/controllers/metadata_controller.rb +++ b/app/controllers/metadata_controller.rb @@ -49,6 +49,7 @@ class MetadataController < ApplicationController logo = SiteSetting.site_manifest_icon_url manifest[:icons] << { src: UrlHelper.absolute(logo), + purpose: "maskable", sizes: "512x512", type: MiniMime.lookup_by_filename(logo)&.content_type || "image/png" } if logo