Skip to content

Instantly share code, notes, and snippets.

@rf5860
Last active December 3, 2022 22:00
Show Gist options
  • Save rf5860/84fc4e98742431d27bffd8740a4787c5 to your computer and use it in GitHub Desktop.
Save rf5860/84fc4e98742431d27bffd8740a4787c5 to your computer and use it in GitHub Desktop.
// ==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