Motherless Age Verification

Automatically clicks 'yes' during age verification

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Motherless Age Verification
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Automatically clicks 'yes' during age verification
// @icon         https://motherless.com/images/logo-header-3.svg
// @author       lol_nocode
// @match        *://*.motherless.com/*
// @run-at       document-start
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    /// 1. Hide modal AND force scroll unlock globally
    const style = document.createElement('style');
    style.textContent = `
        #ml-enter-age-modal {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
        /* Override the website's scroll-lock */
        html, body {
            overflow: auto !important;
            overflow-y: auto !important;
            position: static !important;
        }
    `;
    (document.head || document.documentElement).appendChild(style);

    const targetId = 'ml-age-yes';

    // 2. Core click logic
    const attemptClick = () => {
        const btn = document.getElementById(targetId);
        if (btn) {
            btn.click();
            return true;
        }
        return false;
    };

    // 3. Fallback: MutationObserver for dynamically loaded elements
    const observer = new MutationObserver((mutations, obs) => {
        if (attemptClick()) {
            obs.disconnect(); // Stop watching once clicked
        }
    });

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

    // 4. Stop watching after 3 seconds to save CPU cycles
    setTimeout(() => {
        observer.disconnect();
    }, 3000);
})();