Steam Link Dropdown - Adds Clean Links to Various Safe Sites in a neat dropdown

Adds a quick and easy to access way of finding links to games.

当前为 2025-01-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Steam Link Dropdown - Adds Clean Links to Various Safe Sites in a neat dropdown
  3. // @namespace Karma
  4. // @version 1.1
  5. // @description Adds a quick and easy to access way of finding links to games.
  6. // @author Karma
  7. // @match http://store.steampowered.com/app/*
  8. // @match https://store.steampowered.com/app/*
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. // Helper function to create a styled link
  16. const createLink = (href, text) => {
  17. const link = document.createElement('a');
  18. link.href = href;
  19. link.textContent = text;
  20. link.target = '_blank';
  21. link.style.display = 'block';
  22. link.style.padding = '5px 10px';
  23. link.style.textDecoration = 'none';
  24. link.style.color = '#5095c1';
  25. link.style.backgroundColor = '#2d5071';
  26. link.style.borderBottom = '1px solid #c6d4df';
  27. link.addEventListener('mouseover', () => {
  28. link.style.backgroundColor = '#1b2838';
  29. });
  30. link.addEventListener('mouseout', () => {
  31. link.style.backgroundColor = '#2d5071';
  32. });
  33. return link;
  34. };
  35.  
  36. // Retrieve the game name
  37. const gameName = document.querySelector('.apphub_AppName')?.textContent.trim();
  38. if (!gameName) return;
  39.  
  40. // Get the container for app actions
  41. const appActionContainer = document.querySelector('.apphub_OtherSiteInfo');
  42. if (!appActionContainer) return;
  43.  
  44. // Create the dropdown container
  45. const dropdownContainer = document.createElement('div');
  46. dropdownContainer.style.position = 'absolute';
  47. dropdownContainer.style.top = '100%';
  48. dropdownContainer.style.right = '0';
  49. dropdownContainer.style.backgroundColor = '#2d5071';
  50. dropdownContainer.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.3)';
  51. dropdownContainer.style.border = '1px solid #c6d4df';
  52. dropdownContainer.style.borderRadius = '0px';
  53. dropdownContainer.style.display = 'none';
  54. dropdownContainer.style.zIndex = '1000';
  55. dropdownContainer.style.minWidth = '200px';
  56. document.addEventListener('click', (event) => {
  57. if (!dropdownContainer.contains(event.target) && !dropdownButton.contains(event.target)) {
  58. dropdownContainer.style.display = 'none';
  59. }
  60. });
  61.  
  62. // Button
  63. const dropdownButton = document.createElement('div');
  64. dropdownButton.textContent = 'Safe Sites';
  65. dropdownButton.style.cursor = 'pointer';
  66. dropdownButton.style.padding = '7px 14px';
  67. dropdownButton.style.margin = '2 0px';
  68. dropdownButton.style.backgroundColor = '#2d5071';
  69. dropdownButton.style.color = '#5095c1';
  70. dropdownButton.style.borderRadius = '2px';
  71. dropdownButton.style.textAlign = 'center';
  72. dropdownButton.style.fontfamily = 'arial'
  73. dropdownButton.style.fontSize = '15px';
  74. dropdownButton.style.fontWeight = 'bold';
  75. dropdownButton.style.display = 'inline-block';
  76. dropdownButton.style.border = '0px solid rgba(0, 0, 0, 10)';
  77. dropdownButton.style.position = 'relative';
  78. dropdownButton.addEventListener('click', (event) => {
  79. event.stopPropagation();
  80. dropdownContainer.style.display = dropdownContainer.style.display === 'none' ? 'block' : 'none';
  81. dropdownContainer.style.top = `${dropdownButton.offsetHeight}px`;
  82. dropdownContainer.style.right = '0';
  83. });
  84.  
  85. // List of links to add
  86. const links = [
  87. // Its not hard to add new sites
  88. { href: `https://gog-games.to/?q=${gameName}`, text: 'GOG Games' },
  89. { href: `https://cs.rin.ru/forum/search.php?keywords=${gameName}&terms=any&author=&sc=1&sf=titleonly&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search`, text: 'CS.RIN.RU' },
  90. { href: `https://steamrip.com/?s=${gameName}`, text: 'SteamRip' },
  91. { href: `https://fitgirl-repacks.site/?s=${gameName}`, text: 'FitGirl Repacks' },
  92. { href: `https://ankergames.net/search/${gameName}`, text: 'AnkerGames' },
  93. { href: `https://online-fix.me/index.php?do=search&subaction=search&story=${gameName}`, text: 'Online-Fix' },
  94. { href: `https://gamebounty.world/?s${gameName}`, text: 'GameBounty' },
  95. { href: `https://www.ovagames.com/?s=${gameName}&x=0&y=0`, text: 'OVA Games' },
  96. { href: `https://www.youtube.com/results?search_query=${encodeURIComponent(gameName)}+gameplay+no+commentary`, text: 'Gameplay Vid' },
  97. ];
  98.  
  99. // Append links to the dropdown container
  100. links.forEach(({ href, text }) => {
  101. dropdownContainer.appendChild(createLink(href, text));
  102. });
  103.  
  104. // Append the dropdown button and container beside the "Community Hub" button
  105. appActionContainer.appendChild(dropdownButton);
  106. dropdownButton.appendChild(dropdownContainer);
  107. })();