Greasy Fork is available in English.

Base44 Auto Close Watermark

Automatically clicks the Base44 watermark close (X) button

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.

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

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.

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

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
    });

})();