Skip to content

Commit 97b1af8

Browse files
committed
Fixed icon not showing properly sometimes
1 parent 43b31ca commit 97b1af8

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
No user information is collected in any capacity, it it shall remain that way.
1+
No user information is collected in any capacity, and it shall remain that way.

manifest.crx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "Ecsta",
44
"short_name": "Ecsta",
5-
"version": "0.3.3",
5+
"version": "0.3.4",
66

77
"description": "A simple new tab extension meant to stay out of your way while still making for great eye-candy.",
88

manifest.xpi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"name": "Ecsta",
44
"short_name": "Ecsta",
5-
"version": "0.3.3",
5+
"version": "0.3.4",
66

77
"description": "A simple new tab extension meant to stay out of your way while still making for great eye-candy.",
88

src/res/js/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ const getLastFetchDate = localStorage.getItem("lastFetchDate");
33
const UNSPLASH_API_KEY = localStorage.getItem("unsplashApiKey");
44
var currentDate = new Date().toISOString().split("T")[0];
55

6+
window.onload = () => {
7+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
8+
document.getElementById("tabIcon").setAttribute("href","res/icons/white-256.png")
9+
} else {
10+
document.getElementById("tabIcon").setAttribute("href","res/icons/black-256.png")
11+
}
12+
}
613
if (UNSPLASH_API_KEY) {
714
//Background code
815
function set(fetched) {
@@ -65,11 +72,6 @@ if (UNSPLASH_API_KEY) {
6572
document.getElementById("imgCreator").innerText = ("Image by " + localStorage.getItem("unsplashApiCreditName"));
6673
document.getElementById("imgCreator").setAttribute("href", localStorage.getItem("unsplashApiCreditLink"));
6774
}
68-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
69-
document.getElementById("tabIcon").setAttribute("href","res/icons/white-256.png")
70-
} else {
71-
document.getElementById("tabIcon").setAttribute("href","res/icons/black-256.png")
72-
}
7375
console.log(
7476
`Hasn't been 3 minutes (Has only been ${(
7577
Date.now() / 60000 -

0 commit comments

Comments
 (0)