EpicGames Additional Links

Adds additional links to EpicGames store for free download.

  1. // ==UserScript==
  2. // @name EpicGames Additional Links
  3. // @namespace EpicGames
  4. // @version 1.0.2
  5. // @author Wizzergod
  6. // @description Adds additional links to EpicGames store for free download.
  7. // @grant unsafeWindow
  8. // @grant GM_addStyle
  9. // @grant GM_openInTab
  10. // @match *://store.epicgames.com/*/p/*
  11. // @run-at document-idle
  12. // @inject-into document-auto
  13. // @noframes false
  14. // @icon https://www.google.com/s2/favicons?sz=64&domain=epicgames.com
  15. // @license MIT
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20.  
  21. const NewLinks = [
  22. { url: "https://cs.rin.ru/forum/search.php?keywords=", urlSpecial: "&terms=any&author=&sc=1&sf=titleonly&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search", title: "CS.RIN.RU" },
  23. { url: "https://fitgirl-repacks.site/?s=", title: "Fitgirl" },
  24. { url: "https://gload.to/?s=", title: "Gload" },
  25. { url: "https://gog-games.com/search/", title: "GOG Games" },
  26. { url: "https://gogunlocked.com/?s=", title: "GOG Unlocked" },
  27. { url: "https://steamrip.com/?s=", title: "SteamRIP" },
  28. { url: "https://steamunlocked.net/?s=", title: "Steam Unlocked" },
  29. { url: "https://www.downloadha.com/?s=", title: "DownloadHa" },
  30. { url: "https://www.ovagames.com/?s=", title: "OVA Games" }
  31. ];
  32.  
  33. const titleElement = document.querySelector("title");
  34. const metaElement = document.querySelector('meta[name="og:title"]');
  35. const appName = extractAppName(metaElement ? metaElement.getAttribute("content") : titleElement?.textContent);
  36.  
  37. function extractAppName(title) {
  38. const match = title.match(/^(.*?)\s\|/);
  39. return match ? match[1].trim() : title;
  40. }
  41.  
  42. function createButton(href, text, className) {
  43. let element = document.createElement("a");
  44. element.href = href;
  45. element.target = "_blank";
  46. element.innerHTML = text;
  47. element.className = className;
  48. return element;
  49. }
  50.  
  51. const checkExistEpic = setInterval(() => {
  52. const epicButtons = document.querySelectorAll('.css-66k900');
  53. if (epicButtons.length) {
  54. const buttonClass = epicButtons[0].parentElement.className;
  55. const className = `newbuttons ${buttonClass}`;
  56. NewLinks.forEach(link => {
  57. const button = createButton(link.url + appName + (link.urlSpecial || ""), link.title, className);
  58. epicButtons[0].parentElement.parentElement.insertAdjacentElement('beforebegin', button); // Добавляет после элемента
  59. });
  60. clearInterval(checkExistEpic);
  61. }
  62. }, 100);
  63. })();
  64.  
  65. GM_addStyle(`
  66. .newbuttons {
  67. font-size: 12px !important;
  68. letter-spacing: 0.5px !important;
  69. font-weight: 500 !important;
  70. position: relative !important;
  71. border-radius: 4px !important;
  72. text-transform: uppercase !important;
  73. text-align: center !important;
  74. align-items: center !important;
  75. justify-content: center !important;
  76. line-height: 25px !important;
  77. padding: 5px 10px !important;
  78. height: 25px !important;
  79. display: flex !important;
  80. width: 100% !important;
  81. min-width: auto !important;
  82. background-color: rgba(0, 153, 228, 0.36) !important;
  83. color: rgb(255, 255, 255) !important;
  84. margin-top: 2px !important;
  85. margin-bottom: 2px !important;
  86. border: none !important;
  87. box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.4) !important;
  88. }`);