Greasy Fork 支持简体中文。

GOG additional buttons and downloads

Add GOG DB and GOG Games links to the GOG store

目前為 2023-06-15 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name GOG additional buttons and downloads
  3. // @homepageURL https://gog-games.com/
  4. // @description Add GOG DB and GOG Games links to the GOG store
  5. // @version 4.0.6
  6. // @author Wizzergod
  7. // @license MIT
  8. // @namespace GOG additional buttons and downloads
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=www.gog.com
  10. // @run-at document-end
  11. // @match https://www.gog.com/*/game/*
  12. // @match https://www.gog.com/game/*
  13. // @match https://web.archive.org/web/*
  14. // @grant unsafeWindow
  15. // ==/UserScript==
  16.  
  17.  
  18. (function() {
  19. var productcardData = unsafeWindow.productcardData;
  20. var product_id = productcardData.cardProductId;
  21. var product_slug = productcardData.cardProductSlug;
  22. var product_title = productcardData.cardProduct.title;
  23.  
  24. var separator_element = document.createTextNode(" ");
  25.  
  26. function addLink(text, href, className, targetElement) {
  27. var link_element = document.createElement("a");
  28. link_element.textContent = text;
  29. link_element.setAttribute("href", href);
  30. link_element.className = className;
  31. link_element.setAttribute("target", "_blank");
  32. link_element.style = "margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;";
  33.  
  34. targetElement.parentNode.insertBefore(separator_element.cloneNode(true), targetElement.nextSibling);
  35. targetElement.parentNode.insertBefore(link_element, targetElement.nextSibling);
  36. }
  37.  
  38. var mainButtonDeciderElement = document.querySelector("div[main-button-decider].ng-scope");
  39. if (mainButtonDeciderElement) {
  40. addLink("View on GOGdb", "https://www.gogdb.org/product/" + product_id, "button button--big cart-button ng-scope", mainButtonDeciderElement);
  41. addLink("Download Free from - GoGUnlocked", "https://gogunlocked.com/?s=" + product_title, "button button--big cart-button ng-scope", mainButtonDeciderElement);
  42. addLink("Download Free from - Gog-Games", "https://gog-games.to/search/" + product_title, "button button--big cart-button ng-scope", mainButtonDeciderElement);
  43. addLink("Download Free from - FreeGogPcGames", "https://freegogpcgames.com/?s=" + product_title, "button button--big cart-button ng-scope", mainButtonDeciderElement);
  44. }
  45.  
  46.  
  47. element.style = "margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;";
  48.  
  49. })();