Steam SteamDB Button

Adds a button to steam db info near the add to cart button

  1. // ==UserScript==
  2. // @name Steam SteamDB Button
  3. // @description Adds a button to steam db info near the add to cart button
  4. // @include https://store.steampowered.com/app/*
  5. // @namespace https://gf.qytechs.cn/users/8233
  6. // @license MIT
  7. // @version 0.0.1
  8. // ==/UserScript==
  9.  
  10. var parts = window.location.href.split('/');
  11. if (parts.indexOf('store.steampowered.com') === 2 && parts[3] == 'app') {
  12. var backs = document.getElementsByClassName('game_purchase_action_bg');
  13. for (var i = 0; i < backs.length; ++i) {
  14. //create the link, give it proper href, one of nice steam styles via a class
  15. var a = document.createElement('a');
  16. a.href = 'https://steamdb.info/app/' + parts[4];
  17. a.className = 'btnv6_blue_hoverfade btn_medium';
  18.  
  19. // put text in the button
  20. a.innerHTML = '<span>SteamDB</span>';
  21.  
  22. //and add it to each game buy element we can find (in case there are more cus deluxe edition, bundle, etc.)
  23. var con = backs[i];
  24. con.insertBefore(a, con.firstChild);
  25.  
  26. }
  27. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址