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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user