Update popup.js

simplified compatibility code
main 1.0.4
Nes370 2024-08-10 00:52:42 -07:00
parent 5d2c42788e
commit adbbfb0de1
1 changed files with 5 additions and 9 deletions

View File

@ -2,13 +2,9 @@ document.addEventListener("DOMContentLoaded", function() {
const headerIcon = document.querySelector("#sgdb-icon");
const nesIcon = document.querySelector("#nes-icon");
const giteaIcon = document.querySelector("#gitea-icon");
if(chrome) {
headerIcon.src = chrome.runtime.getURL("icons/icon_32.png");
nesIcon.src = chrome.runtime.getURL("icons/nes_32.png");
giteaIcon.src = chrome.runtime.getURL("icons/gitea_32.png");
} else {
headerIcon.src = browser.runtime.getURL("icons/icon_32.png");
nesIcon.src = browser.runtime.getURL("icons/nes_32.png");
giteaIcon.src = browser.runtime.getURL("icons/gitea_32.png");
}
if(typeof browser === "undefined")
var browser = chrome;
headerIcon.src = browser.runtime.getURL("icons/icon_32.png");
nesIcon.src = browser.runtime.getURL("icons/nes_32.png");
giteaIcon.src = browser.runtime.getURL("icons/gitea_32.png");
});