Greasy Fork

来自缓存

Greasy Fork is available in English.

GOG to Free Download Site

Simply adds a pirate link to all games on the GOG store

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

/* eslint-disable no-multi-spaces */
    var buttonSet = [
        { url: "https://gog-games.to/?q=",           title: "GOG Games" },
    ];
    var siteSet = [
    { url: "https://www.gog.com/game/*",               title: "GOG" },
    { url: /^https:\/\/www\.gog\.com\/[a-z]{2}\/game\/.*/, title: "GOG" },
];

    /*
    All Credit for this userscript goes to Kozinc. I simply removed the unsafe sites from his version. And now I'm adding buttons for other sites based on the r/PiratedGames Megathread.
    */
    // ==UserScript==
    // @name         GOG to Free Download Site
    // @namespace    AnimeIsMyWaifu
    // @author       AnimeIsMyWaifu
    // @version      0.5
    // @description  Simply adds a pirate link to all games on the GOG store
    // @require      https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
    // @include      /^https:\/\/www\.gog\.com\/[a-z]{2}\/game\/.*/
    // @match        https://www.gog.com/game/*
    // @grant        none
    // @license      MIT
    // ==/UserScript==

    var siteSetResult = "";

    siteSet.forEach((el) => {
        if(!!document.URL.match(el.url)) siteSetResult = el.title;
    })

    console.log("Games Links: ", siteSetResult);
    var appName = "";
    switch(siteSetResult) {
        case "GOG":
            appName = document.getElementsByClassName("productcard-basics__title")[0].textContent;
            appName = appName.trim();
            buttonSet.forEach((el) => {
                $("button.cart-button")[0].parentElement.parentElement.append(furnishGOG(el.url+appName, el.title))
            })
            break;
    }

    function furnishGOG(href, innerHTML) {
        let element = document.createElement("a");
        element.target= "_blank";
        element.style = "margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;";
        element.classList.add("button");
        //element.classList.add("button--small");
        element.classList.add("button--big");
        element.classList.add("cart-button");
        element.classList.add("ng-scope");
        element.href = href;
        element.innerHTML= innerHTML;
        return element;
    }