Skip to content

Commit

Permalink
fix: browserActon icon in Chromium 80
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lidel committed Apr 5, 2020
1 parent f473cfd commit 3f220f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions add-on/src/lib/ipfs-companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3f220f3

Please sign in to comment.