Base44 Auto Close Watermark

Automatically clicks the Base44 watermark close (X) button

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!)

Advertisement:

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!)

Advertisement:

// ==UserScript==
// @name         Base44 Auto Close Watermark
// @namespace    https://greasyfork.org/
// @version      1.0
// @description  Automatically clicks the Base44 watermark close (X) button
// @match        https://*.base44.app/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function tryClickClose() {
        // Common patterns for close buttons
        const selectors = [
            'button[aria-label="close"]',
            'button[aria-label="Close"]',
            '[class*="close"]',
            '[class*="Close"]',
            'svg[aria-label="close"]',
            'div[role="button"]'
        ];

        for (const sel of selectors) {
            const elements = document.querySelectorAll(sel);
            for (const el of elements) {
                const text = (el.innerText || el.textContent || '').trim();

                // Try to detect an "X" close button
                if (
                    text === '×' ||
                    text === 'X' ||
                    el.getAttribute?.('aria-label')?.toLowerCase?.() === 'close'
                ) {
                    el.click();
                    return true;
                }
            }
        }
        return false;
    }

    // Run once immediately
    tryClickClose();

    // Watch for dynamically injected watermark
    const observer = new MutationObserver(() => {
        tryClickClose();
    });

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

})();