Last active
October 9, 2020 07:33
-
-
Save mattkrins/470652b0006db6024aa032e11cbcc05f to your computer and use it in GitHub Desktop.
Add button to open steam app on the client
This file contains 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 steam-client-link | |
// @description Add button to open steam app on the client. | |
// @namespace https://gist.github.com/mattkrins | |
// @homepageURL https://gist.github.com/mattkrins/470652b0006db6024aa032e11cbcc05f | |
// @icon https://store.steampowered.com/favicon.ico | |
// @version 1 | |
// @description Integrate web store with client. | |
// @author Matt Krins | |
// @match *://store.steampowered.com/app/* | |
// @grant none | |
// @copyright 2018, mattkrins (https://gist.github.com/mattkrins/) | |
// @license MIT | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
$J(document).ready( function () { | |
let AppID = window.location.pathname.split("app/")[1].split("/")[0]; | |
let cartButton = $J(".btn_addtocart").first(); | |
console.log(cartButton) | |
cartButton.clone().appendTo( cartButton.parent() ).find("a").prop("href", 'steam://run/'+AppID).find("span").text("Open"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preview: