Sfoglia il codice sorgente

fix: remove 19px icon

...as it triggers bugs in FF/Vivaldi
tophf 2 anni fa
parent
commit
daa360c9ca
3 ha cambiato i file con 4 aggiunte e 5 eliminazioni
  1. 1 1
      gulpfile.js
  2. 3 2
      src/background/utils/icon.js
  3. 0 2
      src/manifest.yml

+ 1 - 1
gulpfile.js

@@ -91,7 +91,7 @@ async function createIcons() {
     handle(48),
     handle(128),
     ...types.map(handle16),
-    ...[19, 32, 38].flatMap(size => types.map(t => handle(size, ...t))),
+    ...[32, 38].flatMap(size => types.map(t => handle(size, ...t))),
   ]);
 }
 

+ 3 - 2
src/background/utils/icon.js

@@ -20,6 +20,8 @@ addPublicCommands({
   SetBadge: setBadge,
 });
 
+/** We don't set 19px because FF and Vivaldi scale it down to 16px instead of our own crisp 16px */
+const SIZES = [16, 32];
 /** Caching own icon to improve dashboard loading speed, as well as browserAction API
  * (e.g. Chrome wastes 40ms in our extension's process to read 4 icons for every tab). */
 const iconCache = {};
@@ -172,10 +174,9 @@ function updateState(tab, url = getTabUrl(tab)) {
 }
 
 async function setIcon(tab = {}, data = {}) {
-  // modern Chrome and Firefox use 16/32, other browsers may still use 19/38 (e.g. Vivaldi)
   const mod = data.blocked && 'b' || !isApplied && 'w' || '';
   const iconData = {};
-  for (const n of [16, 19, 32, 38]) {
+  for (const n of SIZES) {
     const path = `${ICON_PREFIX}${n}${mod}.png`;
     const icon = getOwnIcon(path);
     iconData[n] = (icon.then ? await icon : icon).img;

+ 0 - 2
src/manifest.yml

@@ -13,9 +13,7 @@ browser_action:
   browser_style: true
   default_icon:
     '16': public/images/icon16.png
-    '19': public/images/icon19.png
     '32': public/images/icon32.png
-    '38': public/images/icon38.png
   default_title: __MSG_extName__
   default_popup: popup/index.html
 background: