Motherless Age Verification

Automatically clicks 'yes' during age verification

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
})();