// ==UserScript== // @name Another "Open in Steam" Button // @namespace https://github.com/StaticPH // @match http*://steamcommunity.com/* // @match http*://*.steampowered.com/* // @version 1.0 // @createdAt 11/25/2022, 11:25:51 PM // @author StaticPH // @description Another of many scripts attempting to add "Open this in the Steam application" functionality to Steam's webpages. Some CSS borrowed from https://greasyfork.org/en/scripts/454372-open-steam-url // @license MIT // @updateURL https://raw.githubusercontent.com/StaticPH/Userscripts/master/steam_app_from_webpage.user.js // @downloadURL https://raw.githubusercontent.com/StaticPH/Userscripts/master/steam_app_from_webpage.user.js // @homepageURL https://github.com/StaticPH/UserScripts // @supportURL https://github.com/StaticPH/UserScripts/issues // @icon https://www.google.com/s2/favicons?sz=64&domain=steamcommunity.com // @grant none // @noframes // @run-at document-end // ==/UserScript== (function(){ "use strict"; function inject(){ const btnInstallSteam = document.querySelector('#global_action_menu > .header_installsteam_btn'); // SVG from https://fonts.gstatic.com/s/i/materialiconsoutlined/open_in_new/v21/24px.svg const svgOpenExternal = ''; /* In order to consistently place the new "Open in Steam" button across all (public?) Steam Store and Steam Community pages, it is inserted relative to the "Install Steam" button. As a consequence, the "Open in Steam" button is similarly subject to the responsive page design; if the "Install Steam" button isn't visible, the "Open in Steam" button generally wont be either. An example of such such circumstances could be when docking the browser window to one side of the screen (Affected by screen size, resolution, and zoom). */ btnInstallSteam.insertAdjacentHTML('beforeBegin', `
${svgOpenExternal} Open in Steam
` ); document.head.insertAdjacentHTML('beforeEnd', ``); } window.addEventListener('DOMContentLoaded', inject, {once:true}); })();