Last active
December 3, 2022 22:00
-
-
Save rf5860/84fc4e98742431d27bffd8740a4787c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open In Steam | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Open In Steam adds a button to all Steam sites to open the page in Steam. | |
// @author rf5860 | |
// @match /https:\/\/.*steam.*\.com\/.*/ | |
// @match http*://steamcommunity.com/* | |
// @match http*://store.steampowered.com/* | |
// @icon https://www.google.com/s2/favicons?domain=steampowered.com | |
// @grant none | |
// @license MIT | |
// ==/UserScript== | |
var language_pulldown = document.querySelector("#language_pulldown"); | |
var openInSteamLink = document.createElement('a'); | |
openInSteamLink.appendChild(document.createTextNode("Open in steam")); | |
openInSteamLink.className = "global_action_link"; | |
openInSteamLink.title = "Open in steam"; | |
openInSteamLink.href = `steam://openurl/${document.location.href}`; | |
language_pulldown.parentElement.insertBefore(openInSteamLink, language_pulldown); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment