// ==UserScript== // @name Pirate Games // @namespace Kozinc // @version 0.4 // @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 // @match https://www.gog.com/game/* // @match https://www.gog.com/en/game/* // @match https://store.steampowered.com/app/* // @grant GM_registerMenuCommand // @grant GM_getValue // @grant GM_setValue // @grant GM.getValue // @grant GM.setValue // @grant GM_deleteValue // @grant GM_xmlhttpRequest // @run-at document-load // @downloadURL none // ==/UserScript== /* * usergui.js -- https://github.com/AugmentedWeb/UserGui/raw/Release-1.0/usergui.js * v1.0.0 * https://github.com/AugmentedWeb/UserGui * Apache 2.0 licensed */ class UserGui { constructor() { const grantArr = GM_info?.script?.grant; if(typeof grantArr == "object") { if(!grantArr.includes("GM_xmlhttpRequest")) { prompt(`${this.#projectName} needs GM_xmlhttpRequest!\n\nPlease add this to your userscript's header...`, "// @grant GM_xmlhttpRequest"); } if(!grantArr.includes("GM_getValue")) { prompt(`${this.#projectName} needs GM_getValue!\n\nPlease add this to your userscript's header...`, "// @grant GM_getValue"); } if(!grantArr.includes("GM_setValue")) { prompt(`${this.#projectName} needs GM_setValue!\n\nPlease add this to your userscript's header...`, "// @grant GM_setValue"); } } } #projectName = "UserGui"; window = undefined; document = undefined; iFrame = undefined; settings = { "window" : { "title" : "No title set", "name" : "userscript-gui", "external" : false, "centered" : false, "size" : { "width" : 300, "height" : 500, "dynamicSize" : true } }, "gui" : { "centeredItems" : false, "internal" : { "darkCloseButton" : false, "style" : ` body { background-color: #ffffff; overflow: hidden; width: 100% !important; } form { padding: 10px; } #gui { height: fit-content; } .rendered-form { padding: 10px; } #header { padding: 10px; cursor: move; z-index: 10; background-color: #2196F3; color: #fff; height: fit-content; } .header-item-container { display: flex; justify-content: space-between; align-items: center; } .left-title { font-size: 14px; font-weight: bold; padding: 0; margin: 0; } #button-close-gui { vertical-align: middle; } div .form-group { margin-bottom: 15px; } #resizer { width: 10px; height: 10px; cursor: se-resize; position: absolute; bottom: 0; right: 0; } .formbuilder-button { width: fit-content; } ` }, "external" : { "popup" : true, "style" : ` .rendered-form { padding: 10px; } div .form-group { margin-bottom: 15px; } ` } }, "messages" : { "blockedPopups" : () => alert(`The GUI (graphical user interface) failed to open!\n\nPossible reason: The popups are blocked.\n\nPlease allow popups for this site. (${window.location.hostname})`) } }; // This error page will be shown if the user has not added any pages #errorPage = (title, code) => `
${title}
${code}
${this.#projectName} error message