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.
This commit is contained in:
Rafael dos Santos Silva 2019-09-21 11:50:00 -04:00
parent 7f8cdea924
commit 3e590b87cf

View File

@ -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