From 3f220f3cc8d1afcc663e369980e88ff0fccf96db Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sun, 5 Apr 2020 22:57:17 +0200 Subject: [PATCH] fix: browserActon icon in Chromium 80 In past we used SVG in Firefox and if that threw an error (Chromium) we falled back to PNG. Sadly something changed around Chromium 80 and the icon was not properly set on Chromium (including Brave) For now we just use PNG everywhere. --- add-on/src/lib/ipfs-companion.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/add-on/src/lib/ipfs-companion.js b/add-on/src/lib/ipfs-companion.js index faac32f09..33173b454 100644 --- a/add-on/src/lib/ipfs-companion.js +++ b/add-on/src/lib/ipfs-companion.js @@ -497,6 +497,9 @@ module.exports = async function init () { } async function setBrowserActionIcon (iconPath) { + return browser.browserAction.setIcon(rasterIconDefinition(iconPath)) + /* Below fallback does not work since Chromium 80 + * (it fails in a way that does not produce error we can catch) const iconDefinition = { path: iconPath } try { // Try SVG first -- Firefox supports it natively @@ -508,6 +511,7 @@ module.exports = async function init () { // Still, we want icon, so we precompute rasters of popular sizes and use them instead await browser.browserAction.setIcon(rasterIconDefinition(iconPath)) } + */ } // ColorArray [0,0,0,0] → Hex #000000