Skip to content

Instantly share code, notes, and snippets.

@The24thDS
Last active January 19, 2023 17:14
Show Gist options
  • Save The24thDS/707f4be5e356fae96d76b19ee7765d7e to your computer and use it in GitHub Desktop.
Save The24thDS/707f4be5e356fae96d76b19ee7765d7e to your computer and use it in GitHub Desktop.
Tampermonkey script for opening Steam store pages in the client
// ==UserScript==
// @name Open in Steam
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description Adds a button on Steam store page that can be used to open that page inside the Steam client;
// @author The24thDS
// @match https://store.steampowered.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=steampowered.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const element = document.createElement('a');
element.setAttribute('href', `steam://openurl/${window.location.href}`);
element.setAttribute('style', `position: absolute; top: 20px; right: 20px; padding: 5px 20px; border-radius: 5px; background-color: #c5c3c0; color: #171a21; font-weight: bold;`);
element.innerHTML = 'Open in Steam';
document.body.appendChild(element);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment