const url = window.location.href; const appIDMatch = url.match(/\/app\/(\d+)/); if(appIDMatch) { const buttonContainer = document.querySelector(".apphub_OtherSiteInfo"); if(buttonContainer) { 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"; sgdb_button.style.marginRight = "3px"; sgdb_button.style.marginLeft = "3px"; const span = document.createElement('span'); span.setAttribute("data-tooltip-text", "View on SteamGridDB"); const icon = document.createElement("img"); icon.className = "ico16"; if(chrome) { icon.src = chrome.runtime.getURL("icons/sgdb_16.png"); } else { icon.src = browser.runtime.getURL("icons/sgdb_16.png"); } icon.style.backgroundImage = "none"; span.append(icon); sgdb_button.append(span); buttonContainer.prepend(sgdb_button); } }