hgamefree.info captcha skip

移除 Google reCAPTCHA v2 的所有可視框架與遮罩

目前為 2025-05-29 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         hgamefree.info captcha skip
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  移除 Google reCAPTCHA v2 的所有可視框架與遮罩
// @author       Lin_tsen
// @match        https://hgamefree.info/adult-video-game/h-game/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function removeElements() {
        // 移除圖片驗證主框
        const captcha = document.getElementById("rc-imageselect");
        if (captcha) captcha.remove();

        // 移除底部黑框
        const footer = document.querySelector(".rc-footer");
        if (footer) footer.remove();

        // 移除含 iframe 的主外殼 div(z-index 非常高)
        const recaptchaBubble = Array.from(document.querySelectorAll("div"))
            .find(div => div.style.zIndex === "2000000000" && div.querySelector("iframe"));
        if (recaptchaBubble) recaptchaBubble.remove();

        // 可選:移除所有包含 "g-recaptcha-bubble-arrow" 的 div
        const arrows = document.querySelectorAll(".g-recaptcha-bubble-arrow");
        arrows.forEach(el => el.remove());
    }

    const observer = new MutationObserver(() => {
        removeElements();
    });

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

    // 預防初始已載入
    removeElements();
})();