Skip to content

Commit

Permalink
Make icons react to color-scheme properly.
Browse files Browse the repository at this point in the history
Note that due to https://bugzilla.mozilla.org/show_bug.cgi?id=1779457 /
w3c/csswg-drafts#7213, prefers-color-scheme
works fine even if the user has an explicitly light theme or so.

This fixes mozilla#2583 too.
  • Loading branch information
emilio committed Oct 8, 2023
1 parent bb24647 commit ae1b618
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
Binary file removed src/img/container-site-d-24.png
Binary file not shown.
Binary file removed src/img/container-site-d-48.png
Binary file not shown.
Binary file removed src/img/container-site-d-96.png
Binary file not shown.
9 changes: 0 additions & 9 deletions src/img/multiaccountcontainer-16-dark.svg

This file was deleted.

10 changes: 8 additions & 2 deletions src/img/multiaccountcontainer-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/js/content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit ae1b618

Please sign in to comment.