From 1b7ad15d06bcd79dca9deefd0c0fa3ee9a133698 Mon Sep 17 00:00:00 2001 From: Nes370 Date: Thu, 8 Aug 2024 16:59:43 -0700 Subject: [PATCH] Split popup script into separate file After testing found that in-line javascript is discouraged due to security policy settings, so split that into a separate file. --- manifest.json | 2 +- popup.html | 13 ++----------- popup.js | 8 ++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 popup.js diff --git a/manifest.json b/manifest.json index ff46e7d..64b9d0e 100644 --- a/manifest.json +++ b/manifest.json @@ -31,7 +31,7 @@ ], "web_accessible_resources": [ { - "resources": [ "icons/sgdb_16.png", "icons/nes_32.png" ], + "resources": [ "icons/sgdb_16.png" ], "matches": [ "*://store.steampowered.com/app/*", "*://steamcommunity.com/app/*" ] } ] diff --git a/popup.html b/popup.html index 7d029a6..02c3816 100644 --- a/popup.html +++ b/popup.html @@ -41,20 +41,11 @@ height: 22px; } - +

- SGBD Button on Steam + SGBD Button on Steam

diff --git a/popup.js b/popup.js new file mode 100644 index 0000000..9e4f396 --- /dev/null +++ b/popup.js @@ -0,0 +1,8 @@ +document.addEventListener("DOMContentLoaded", function() { + const headerIcon = document.querySelector("#sgdb-icon"); + const nesIcon = document.querySelector("#nes-icon"); + const giteaIcon = document.querySelector("#gitea-icon"); + 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"); +});