您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a convenient link to the Privacy & Subscriptions webpage directly from the Claim banner
当前为
// ==UserScript== // @name GOG Claim Helper // @namespace http://tampermonkey.net/ // @version 1.0 // @description Add a convenient link to the Privacy & Subscriptions webpage directly from the Claim banner // @author You // @match https://www.gog.com/en // @match https://www.gog.com // @icon https://www.google.com/s2/favicons?sz=64&domain=gf.qytechs.cn // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 1. if button with class giveaway-banner__button is found, add a second button to // https://www.gog.com/en/account/settings/subscriptions // let giveawayButton = document.getElementsByClassName("giveaway-banner__button"); if (giveawayButton.length > 0) { // document.getElementsByClassName("giveaway-banner__footer")[0]; let element = document.createElement("button"); element.id = "SettingsSubscriptionsButtonLink"; element.style = "border: 1px solid transparent; border-radius: 3px; box-shadow: var(--theme-button-shadow); min-height: 46px; color: var(--theme-button-primary-text); background: var(--theme-button-primary) padding-box,var(--theme-button-primary-border);border-top-color: var(--theme-button-primary-border-top);border-bottom-color: var(--theme-button-primary-border-bottom);flex-shrink: 0;position: relative;padding: 16px 0;cursor: pointer; padding: 5px 10px 5px 10px;"; element.onclick= function(e) { e.preventDefault(); window.open('https://www.gog.com/en/account/settings/subscriptions'); e.stopImmediatePropagation(); }; // element.classList.add("giveaway-banner__button"); element.innerHTML= '<span class="giveaway-banner__button-text">Privacy & subscriptions</span>'; document.getElementsByClassName("giveaway-banner__footer")[0].append(element); } // 2 if giveaway-banner__success is found, // add a button to giveaway-banner__button -> https://www.gog.com/en/account/settings/subscriptions // https://www.gog.com/en/account/settings/subscriptions var container = document.documentElement || document.body; const observer = new MutationObserver(function(mutations_list) { mutations_list.forEach(function(mutation) { if(mutation.target.id == 'giveaway') { console.log('new mutation'); console.log(mutation) console.log(typeof mutation.target) console.log('giveaway-banner__success has been added'); let element = document.createElement("button"); element.id = "SettingsSubscriptionsButton"; element.style = "border: 1px solid transparent; border-radius: 3px; box-shadow: var(--theme-button-shadow); min-height: 46px; color: var(--theme-button-primary-text); background: var(--theme-button-primary) padding-box,var(--theme-button-primary-border);border-top-color: var(--theme-button-primary-border-top);border-bottom-color: var(--theme-button-primary-border-bottom);flex-shrink: 0;position: relative;padding: 16px 0;width: 100%;cursor: pointer;margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;"; element.onclick= function(e) { e.preventDefault(); window.open('https://www.gog.com/en/account/settings/subscriptions'); e.stopImmediatePropagation(); }; // element.classList.add("giveaway-banner__button"); element.innerHTML= '<span>Privacy & subscriptions</span>'; console.log('giveaway appended 1'); if(!document.getElementById("SettingsSubscriptionsButton")) { document.getElementsByClassName("giveaway-banner__success-inner")[0].append(element); console.log('giveaway appended'); } // observer.disconnect(); } }); }); observer.observe(container, { subtree: true, attributes: true, childList: true, characterData: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址