2024-08-08 10:34:58 -07:00
|
|
|
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";
|
2024-08-08 14:49:18 -07:00
|
|
|
icon.src = browser.runtime.getURL("icons/sgdb_16.png");
|
2024-08-08 13:38:37 -07:00
|
|
|
icon.style.backgroundImage = "none";
|
2024-08-08 10:34:58 -07:00
|
|
|
span.append(icon);
|
|
|
|
|
|
|
|
sgdb_button.append(span);
|
|
|
|
|
|
|
|
const buttonContainer = document.querySelector(".apphub_OtherSiteInfo");
|
|
|
|
if(buttonContainer) {
|
|
|
|
sgdb_button.style.marginRight = "3px";
|
2024-08-08 14:49:18 -07:00
|
|
|
sgdb_button.style.marginLeft = "3px";
|
2024-08-08 10:34:58 -07:00
|
|
|
buttonContainer.prepend(sgdb_button);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|