补充包制作器快捷方式

Steam补充包制作器快捷方式

目前为 2021-06-20 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Boosterpack_Link
  3. // @name:zh-CN 补充包制作器快捷方式
  4. // @namespace https://blog.chrxw.com
  5. // @version 1.0
  6. // @description Steam补充包制作器快捷方式
  7. // @description:zh-CN Steam补充包制作器快捷方式
  8. // @author Chr_
  9. // @include /https://steamcommunity\.com/(id|profiles)/[^\/]+/gamecards/(\d+)/?$/
  10. // @include /https://steamcommunity\.com/(id|profiles)/[^\/]+/badges/?$/
  11. // @license AGPL-3.0
  12. // @icon https://blog.chrxw.com/favicon.ico
  13. // ==/UserScript==
  14.  
  15. window.addEventListener('load', () => {
  16. 'use strict';
  17. const blackList = ['1658760'];
  18.  
  19. if (window.location.pathname.search('gamecards') === -1) {
  20.  
  21. let rows = document.querySelectorAll('div.badges_sheet > div.badge_row');
  22. rows.forEach((ele) => {
  23. let link = ele.querySelector('a.badge_row_overlay');
  24.  
  25. if (link !== null) {
  26.  
  27. let appid = link.href.match(/gamecards\/(\d+)/);
  28.  
  29. appid = appid ? appid[1] : -1;
  30. if (appid < 0) {
  31. console.log('获取appid失败');
  32. } else if (blackList.indexOf(appid) > -1) {
  33. console.log('跳过黑名单');
  34. } else {
  35. let btn = document.createElement('button');
  36.  
  37. btn.style.cssText = 'position: absolute;right: 300px;top: 10px;z-index: 99;'
  38. btn.addEventListener('click', () => {
  39. window.open(`https://steamcommunity.com/tradingcards/boostercreator/#${appid}`);
  40. });
  41. btn.textContent = '我要做包';
  42.  
  43. ele.appendChild(btn);
  44. }
  45. }
  46. });
  47. } else {
  48. let title = document.querySelector('div.badge_title');
  49. let appid = window.location.pathname.match(/gamecards\/(\d+)/);
  50.  
  51. appid = appid ? appid[1] : -1;
  52. if (appid < 0) {
  53. console.log('获取appid失败');
  54. } else if (blackList.indexOf(appid) > -1) {
  55. console.log('跳过黑名单');
  56. } else {
  57. let btn = document.createElement('button');
  58.  
  59. btn.style.cssText = 'position: absolute;right: 300px;top: 10px;z-index: 99;'
  60. btn.addEventListener('click', () => {
  61. window.open(`https://steamcommunity.com/tradingcards/boostercreator/#${appid}`);
  62. });
  63. btn.textContent = '我要做包';
  64.  
  65. title.appendChild(btn);
  66. }
  67. }
  68. });

QingJ © 2025

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