Motherless Age Verification

Automatically clicks 'yes' during age verification

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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