GOG additional buttons and downloads

Add GOG DB and GOG Games links to the GOG store

2023-06-05 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name GOG additional buttons and downloads
// @homepageURL https://gog-games.com/
// @description Add GOG DB and GOG Games links to the GOG store
// @version 4.0.5
// @author Wizzergod
// @license MIT
// @namespace GOG additional buttons and downloads
// @icon https://www.google.com/s2/favicons?sz=64&domain=www.gog.com
// @run-at document-end
// @match https://www.gog.com/*/game/*
// @match https://www.gog.com/game/*
// @grant unsafeWindow
// ==/UserScript==


(function() {
  var productcardData = unsafeWindow.productcardData;
  var product_id = productcardData.cardProductId;
  var product_slug = productcardData.cardProductSlug;
  var product_title = productcardData.cardProduct.title;

  var separator_element = document.createTextNode(" ");

  function addLink(text, href, className, targetElement) {
    var link_element = document.createElement("a");
    link_element.textContent = text;
    link_element.setAttribute("href", href);
    link_element.className = className;
    link_element.setAttribute("target", "_blank");
    link_element.style = "margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;";

    targetElement.parentNode.insertBefore(separator_element.cloneNode(true), targetElement.nextSibling);
    targetElement.parentNode.insertBefore(link_element, targetElement.nextSibling);
  }

  var mainButtonDeciderElement = document.querySelector("div[main-button-decider].ng-scope");
  if (mainButtonDeciderElement) {
    addLink("View on GOGdb", "https://www.gogdb.org/product/" + product_id, "button button--big cart-button ng-scope", mainButtonDeciderElement);
    addLink("Download Free from - GoGUnlocked", "https://gogunlocked.com/?s=" + product_title, "button button--big cart-button ng-scope", mainButtonDeciderElement);
    addLink("Download Free from - Gog-Games", "https://gog-games.com/game/" + product_slug, "button button--big cart-button ng-scope", mainButtonDeciderElement);
    addLink("Download Free from - FreeGogPcGames", "https://freegogpcgames.com/?s=" + product_slug, "button button--big cart-button ng-scope", mainButtonDeciderElement);
  }


        element.style = "margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;";

})();