Compare commits

..

2 Commits

Author SHA1 Message Date
Nes370 f263c0358f Update manifest.json
bumped version number for significant change.
2024-08-08 17:00:05 -07:00
Nes370 1b7ad15d06 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.
2024-08-08 16:59:43 -07:00
3 changed files with 12 additions and 13 deletions

View File

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "SGDB Button on Steam",
"version": "1.0.1",
"version": "1.0.2",
"description": "Adds a button on Steam game pages to bring you to its SteamGridDB entry.",
"icons": {
"16": "icons/icon_16.png",
@ -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/*" ]
}
]

View File

@ -41,20 +41,11 @@
height: 22px;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
const headerIcon = document.querySelector("#sgdb-icon");
const nesIcon = document.querySelector("#nes-icon");
const giteaIcon = document.createElement("#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");
});
</script>
<script src="popup.js" defer></script>
</head>
<body>
<h2>
<img id="header-icon" src="" style="vertical-align: middle; display: inline"> SGBD Button on Steam
<img id="sgdb-icon" src="" style="vertical-align: middle; display: inline"> SGBD Button on Steam
</h2>
<a class="btn" href="https://www.steamgriddb.com/profile/76561198274324627">
<span data-tooltip-text="View my profile">

8
popup.js Normal file
View File

@ -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");
});