GOG Store: add direct search to gog-games and 'no commentary' gameplay videos.

Adds links for Gog store to gameplay videos without youtubers voice and direct search on Gog-games.to. Based on CrazyMan390's script. You can also use Ublock to remove "Buy" links like the screenshot.

当前为 2024-08-03 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GOG Store: add direct search to gog-games and 'no commentary' gameplay videos.
// @namespace    masterofobzene
// @author       masterofobzene
// @version      1.3
// @description  Adds links for Gog store to gameplay videos without youtubers voice and direct search on Gog-games.to. Based on CrazyMan390's script. You can also use Ublock to remove "Buy" links like the screenshot.
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @match        https://www.gog.com/game/*
// @match        https://www.gog.com/en/game/*
// @homepage
// @run-at       document-end
// @grant        none
// @license      MIT
// ==/UserScript==

var pirateLinks = [{
        url: "https://gog-games.to/?search=",
        urlSpecial: "",
        title: "Search on GoG-Games"
    },
        {
        url: "https://www.youtube.com/results?search_query=",
        urlSpecial: "" + 'gameplay no commentary',
        title: "Gameplay Video"
                   },
];

var storePages = [{
        url: "https://www.gog.com/en/game/*",
        title: "GOG"
    }];

var storePageResult = "";

storePages.forEach((e) => {
    if (!!document.URL.match(e.url)) storePageResult = e.title;
})

console.log("Domain Match: ", storePageResult);

var appName = "";

switch (storePageResult) {
    case "GOG":
        appName = document.getElementsByClassName("productcard-basics__title")[0].textContent;
        pirateLinks.forEach((e) => {
            $("button.cart-button")[0].parentElement.parentElement.append(rigGOG(e.url + appName + e.urlSpecial, e.title))
        })
        break;
}

function rigGOG(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--big");
    element.classList.add("cart-button");
    element.classList.add("ng-scope");
    element.href = href;
    element.innerHTML = innerHTML;
    return element;
}