Greasy Fork

Greasy Fork is available in English.

动画疯自动同意

自动同意动画疯网站的年龄验证提示。

当前为 2024-09-20 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name                Ani Gamer Age Verification Auto Agree
// @icon                https://ani.gamer.com.tw/favicon.ico
// @name:zh-TW          動畫瘋自動同意
// @name:zh-CN          动画疯自动同意
// @namespace           electroknight22_ani_gamer_age_verification_auto_agree_namespace
// @match               *://*ani.gamer.com.tw/animeVideo.php*
// @match               *://*ani.gamer.com.tw/party.php*
// @version             1.0.0
// @author              ElectroKnight22
// @license             MIT
// @description         Automatically agrees to the age verification prompt on the Ani-Gamer website.
// @description:zh-TW   自動同意動畫瘋網站的年齡驗證提示。
// @description:zh-CN   自动同意动画疯网站的年龄验证提示。
// ==/UserScript==

(function() {
    'use strict';

    waitForElement('.choose-btn-agree').then((element) => {
        console.log(`Agreement button found: "${element.textContent}". Automatically agreeing for the user.`);
        element.click();
    });

    function waitForElement(selector) {
        return new Promise(resolve => {
            const element = document.querySelector(selector);
            if (element) {
                resolve(element);
                return;
            }

            const observer = new MutationObserver(mutations => {
                for (const mutation of mutations) {
                    for (const node of mutation.addedNodes) {
                        if (node.nodeType === Node.ELEMENT_NODE) {
                            if (node.matches(selector)) {
                                observer.disconnect();
                                resolve(node);
                                return;
                            }
                            const matchingDescendant = node.querySelector(selector);
                            if (matchingDescendant) {
                                observer.disconnect();
                                resolve(matchingDescendant);
                                return;
                            }
                        }
                    }
                }
            });

            observer.observe(document.body, {
                childList: true,
                subtree: true
            });
        });
    }
})();