Motherless Age Verification

Automatically clicks 'yes' during age verification

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

(I already have a user style manager, let me install it!)

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