Initial Commit

Mostly functional extension!
main
Nes370 2024-08-08 10:34:58 -07:00
commit 6fd2bf7771
10 changed files with 80 additions and 0 deletions

BIN
icons/icon_128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
icons/icon_16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/icon_16_white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
icons/icon_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

BIN
icons/icon_48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

BIN
icons/icon_64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
icons/icon_96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

33
manifest.json Normal file
View File

@ -0,0 +1,33 @@
{
"manifest_version": 3,
"name": "SGDB Button on Steam",
"version": "1.0.0",
"description": "Adds a button on Steam game pages to bring you to its SteamGridDB entry.",
"permissions": [
"storage"
],
"action": {
"default_icon": "icons/icon_128.png",
"default_popup": "popup.html"
},
"icons": {
"16": "icons/icon_16.png",
"32": "icons/icon_32.png",
"48": "icons/icon_48.png",
"64": "icons/icon_64.png",
"96": "icons/icon_96.png",
"128": "icons/icon_128.png"
},
"content_scripts": [
{
"matches": [ "*://store.steampowered.com/app/*", "*://steamcommunity.com/app/*" ],
"js": [ "script.js" ]
}
],
"web_accessible_resources": [
{
"resources": [ "icons/icon_16_white.png" ],
"matches": [ "*://store.steampowered.com/app/*", "*://steamcommunity.com/app/*" ]
}
]
}

20
popup.html Normal file
View File

@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="icon" href="icons/icon_128.png">
<title>SGBD Button Placement</title>
<style>
body {
font-family: "Open Sans", sans-serif;
background-color: #32414c;
color: #8ecaf4;
}
</style>
</head>
<body>
<h2 style="text-align: center"><img src="moz-extension://74d32219-b2a6-4a7f-bec5-0b89b0441173/icons/icon_32.png" style="vertical-align: middle; display: inline"> SGBD Button on Steam</h2>
<p style="text-align: center">Created by <a href="https://www.steamgriddb.com/profile/76561198274324627" style="color: #FC2A7C">Nes</a> <a href="https://www.steamgriddb.com/profile/76561198274324627"><img src="https://avatars.steamstatic.com/ee0596d5cbba554a4e7b1adb7bac26e740336975_full.jpg" style="vertical-align: middle; display: inline; height: 36px"></a></p>
</body>
</html>

27
script.js Normal file
View File

@ -0,0 +1,27 @@
const url = window.location.href;
const appIDMatch = url.match(/\/app\/(\d+)/);
if(appIDMatch) {
const appID = appIDMatch[1];
const sgdb_button = document.createElement('a');
sgdb_button.href = `https://steamgriddb.com/steam/${appID}`;
sgdb_button.className = "btnv6_blue_hoverfade btn_medium";
const span = document.createElement('span');
span.setAttribute("data-tooltip-text", "View on SteamGridDB");
const icon = document.createElement("img");
icon.className = "ico16";
icon.src = "moz-extension://74d32219-b2a6-4a7f-bec5-0b89b0441173/icons/icon_16_white.png";
span.append(icon);
sgdb_button.append(span);
const buttonContainer = document.querySelector(".apphub_OtherSiteInfo");
if(buttonContainer) {
sgdb_button.style.marginRight = "3px";
buttonContainer.prepend(sgdb_button);
}
}