From 3779f86088cfb746f0f66d3fb3b9aa14a534bec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 9 Oct 2023 00:52:28 +0200 Subject: [PATCH] Make icons react to color-scheme properly. Note that due to https://bugzilla.mozilla.org/show_bug.cgi?id=1779457 / https://github.com/w3c/csswg-drafts/issues/7213, prefers-color-scheme works fine even if the user has an explicitly light theme or so. This fixes #2583 entirely. --- src/img/container-site-d-24.png | Bin 342 -> 0 bytes src/img/container-site-d-48.png | Bin 578 -> 0 bytes src/img/container-site-d-96.png | Bin 1028 -> 0 bytes src/img/multiaccountcontainer-16-dark.svg | 9 --------- src/img/multiaccountcontainer-16.svg | 10 ++++++++-- src/js/content-script.js | 3 ++- src/manifest.json | 8 ++++---- 7 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 src/img/container-site-d-24.png delete mode 100644 src/img/container-site-d-48.png delete mode 100644 src/img/container-site-d-96.png delete mode 100644 src/img/multiaccountcontainer-16-dark.svg diff --git a/src/img/container-site-d-24.png b/src/img/container-site-d-24.png deleted file mode 100644 index 3ef2901664424112836124c67d22bec15ff203a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 342 zcmV-c0jd6pP)K#u$Q#NAM6XT)6N8Z{aZ%6#M~k;ldasx)D8vOQDY7HC%WAK@@`HWDqwa zv@z4uGmvcbLDSv!s_JzW)rq7L(4!t7X4aiXNO}M^fT5Y4_?(MO4zL*M_XDm?P!pt0 z10*HD=|ttL<-RFt=-FQz3joW&Sp~OVuJ#oGBj6rb@@#9s3h)FxdiIyb0%leKTN7>j zo}#;HQ#4aJAdmDd+6r7oh~&UkfPXIcw^?`O7m~Jtl6r)HcV=eqiKGkQ2v`U>kAZ75 zJ1&#o0J}90`~(ILIIKxd$sc(4orvlkuz6Eg+|Un_1rl1+B-=>Px#07*qoM6N<$g0?S=&Hw-a diff --git a/src/img/container-site-d-48.png b/src/img/container-site-d-48.png deleted file mode 100644 index beb0bfaccbc90c9cb58a75814846974fb743b9c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 578 zcmV-I0=@l-P)%-6o#K&CyGFVQ6gGsV`61xqn-YNH=#l-h=xKNO)wfmWoI-73Kh{{fe;?B;5mEI}YB+bxEhpY`n?3D-FW~TmVi3-}8#fz~dGUUuV=q z=B@(gJmmID>JBB~izDqW5QHdDG>Ln}{*crK^yM6KB4h2mq`Vn_1QC$bN%fDZugTKS zd+dJ=^%d$p!0`LwV%whsp#-*o9S^ycAm@OYtwBz^<0fQJXD z{RC__y#4|#g?b|*|1G7^4QuxX#~foe&8z}Yl5`Xp1BQVv*I-}{7%{W0)ZpE~6fl7M z6N_!&9q=dtUI6zU1M74GcWNRJQhQ^-%@+0P07ihHWnid9p^e0ku?Vhl;2i Qxc~qF07*qoM6N<$g5H+`H~;_u diff --git a/src/img/container-site-d-96.png b/src/img/container-site-d-96.png deleted file mode 100644 index 3c3e0323ff44734ac5407d32ee8806aba7fc03c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1028 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD3?#3*wF4y>^8$QAT!CEQQ9!Q{m??0y6&T`` zB|(0{42(?7EUawo9Gu)dynOtELZV{g64EkqO3JG0TDrz2rWRJ#Huf&=p8kPBk@1PC zX_+~>c?G3q<<+$fO|5+sCrz0;ZN|)b3l=Y5v1-e<9Xt2zJ#_fUvEwIBojHH;(&Z~x zuid=;@bQyp&tJZI_u=EG&tJcN|MBzJ?>~S43AbD`1V;ZEPZ!6KjC*fqxCb)@3beQ% zog*q*d`QM%(Tw6l9Z5%eA_aus{QfSNvOPe2+xJ+VwJ%?noDZ+A*lgT(}W}0 zC^MF1`{Ubi^+^6VuUE1>EEkXXYV%vO88k3*Jdk`ZzwHFWw!#Mgtivx4GWuyYr1Jl3 zI8)IObN2FzVBIfCfBC&1<^TG(;`!Q$^;v}#a=p9Q_ts`|`f>WIcL_NC*xhmT*KV(q z<`d4%&|YmA&?2!KjQ_<*9XP(VY)j5jW92Q~v(JYdP?~4COd+pti5sJw&1a>rm%q(8tza#K7VGs( UA8d*XfQgI2)78&qol`;+07JWzC;$Ke diff --git a/src/img/multiaccountcontainer-16-dark.svg b/src/img/multiaccountcontainer-16-dark.svg deleted file mode 100644 index 3c1e24c..0000000 --- a/src/img/multiaccountcontainer-16-dark.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/img/multiaccountcontainer-16.svg b/src/img/multiaccountcontainer-16.svg index d6a13d1..bb68c83 100644 --- a/src/img/multiaccountcontainer-16.svg +++ b/src/img/multiaccountcontainer-16.svg @@ -1,7 +1,13 @@ - + - \ No newline at end of file + diff --git a/src/js/content-script.js b/src/js/content-script.js index 539e43a..fba6e09 100644 --- a/src/js/content-script.js +++ b/src/js/content-script.js @@ -24,11 +24,12 @@ async function addMessage(message) { divElement.innerText = message.text; const imageElement = document.createElement("img"); - const imagePath = browser.runtime.getURL("/img/container-site-d-24.png"); + const imagePath = browser.runtime.getURL("/img/multiaccountcontainer-16.svg"); const response = await fetch(imagePath); const blob = await response.blob(); const objectUrl = URL.createObjectURL(blob); imageElement.src = objectUrl; + imageElement.width = imageElement.height = 24; divElement.prepend(imageElement); document.body.appendChild(divElement); diff --git a/src/manifest.json b/src/manifest.json index 1ce9a41..6ec32f3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -5,8 +5,8 @@ "incognito": "not_allowed", "description": "__MSG_extensionDescription__", "icons": { - "48": "img/container-site-d-48.png", - "96": "img/container-site-d-96.png" + "48": "img/multiaccountcontainer-16.svg", + "96": "img/multiaccountcontainer-16.svg" }, "homepage_url": "https://github.com/mozilla/multi-account-containers#readme", "permissions": [ @@ -118,7 +118,7 @@ "default_popup": "popup.html", "theme_icons": [ { - "light": "img/multiaccountcontainer-16-dark.svg", + "light": "img/multiaccountcontainer-16.svg", "dark": "img/multiaccountcontainer-16.svg", "size": 32 } @@ -151,7 +151,7 @@ ], "default_locale": "en", "web_accessible_resources": [ - "/img/container-site-d-24.png" + "/img/multiaccountcontainer-16.svg" ], "options_ui": { "page": "options.html",