helioobianchi

gg.deals link in Steam page

Jun 20th, 2022 (edited)
791
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         gg.deals link in Steam page
  3. // @namespace    http://github.com/helioobianchi
  4. // @version      0.2
  5. // @description  turns "Community Hub" into a link to gg.deals page
  6. // @author       helioobianchi
  7. // @match        https://store.steampowered.com/app/*
  8. // @match        https://store.steampowered.com/sub/*
  9. // @match        https://store.steampowered.com/bundle/*
  10. // @match        https://store.steampowered.com/friendsthatplay/*
  11. // @match        https://store.steampowered.com/gamecards/*
  12. // @match        https://store.steampowered.com/recommended/*
  13. // @match        https://store.steampowered.com/widget/*
  14. // @icon         https://www.google.com/s2/favicons?sz=64&domain=gg.deals
  15. // @grant        none
  16. // ==/UserScript==
  17.  
  18. (function() {
  19.     'use strict';
  20.  
  21. let hubLink = document.querySelector('.apphub_OtherSiteInfo a:last-child');
  22. hubLink.href = location.href.replace(/store\.steampowered.com/g, 'gg\.deals/steam');
  23. hubLink.querySelector('span').setAttribute('data-tooltip-text', 'View on gg.deals');
  24. hubLink.querySelector('span').innerHTML = '<img alt="GG.logo" src="https://gg.deals/favicon-32x32.png" style="height: 100%;">';
  25.  
  26. console.log('gg.deals replacement ran');
  27.  
  28. })();
  29.  
RAW Paste Data Copied