Enable Mediafire URL (Identi)

Elimina el modal "servidores no autorizados" (detección errónea de MF) y permite publicar/editar normalmente.

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

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         Enable Mediafire URL (Identi)
// @namespace    http://tampermonkey.net/
// @match        *://identi.io/*
// @version      3.1
// @description  Elimina el modal "servidores no autorizados" (detección errónea de MF) y permite publicar/editar normalmente.
// @author       AjoloteMX / Actualizado por Bluembee
// @icon         https://i.postimg.cc/RC6Rdtwv/avatar.png
// @grant        none
// @license MIT
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    const MEDIAFIRE_REGEX = /mediafire\.com/i;
    const MODAL_TEXT = 'servidores no autorizados';

    /* --------------------------------------------------
       1. Forzar checkBlockedURL
    -------------------------------------------------- */
    function patchCheckBlockedURL() {
        if (typeof window.checkBlockedURL !== 'function') return;
        if (window.checkBlockedURL.__patched) return;

        const original = window.checkBlockedURL;
        window.checkBlockedURL = function (txt) {
            if (MEDIAFIRE_REGEX.test(txt)) return true;
            return original.call(this, txt);
        };

        window.checkBlockedURL.__patched = true;
    }

    /* --------------------------------------------------
       2. Eliminar el modal falso apenas aparezca
    -------------------------------------------------- */
    function killMediafireModal(root = document) {
        const modals = root.querySelectorAll('div');
        modals.forEach(div => {
            const text = div.textContent?.toLowerCase() || '';
            if (
                text.includes(MODAL_TEXT) &&
                text.includes('mediafire')
            ) {
                console.info('[MediaFire Unlocker] Modal eliminado');
                div.remove();

                // quitar overlay si existe
                document.body.style.overflow = '';
                document.querySelectorAll('.modal-backdrop, .overlay')
                    .forEach(e => e.remove());
            }
        });
    }

    /* --------------------------------------------------
       3. Forzar submit aunque el editor intente bloquear
    -------------------------------------------------- */
    function patchForms() {
        document.querySelectorAll('form').forEach(form => {
            if (form.__patched) return;

            form.addEventListener('submit', e => {
                const content = form.innerText || '';
                if (MEDIAFIRE_REGEX.test(content)) {
                    e.stopImmediatePropagation();
                }
            }, true);

            form.__patched = true;
        });
    }

    /* --------------------------------------------------
       Observador general
    -------------------------------------------------- */
    const observer = new MutationObserver(mutations => {
        patchCheckBlockedURL();
        patchForms();

        mutations.forEach(m => {
            m.addedNodes.forEach(n => {
                if (n.nodeType === 1) killMediafireModal(n);
            });
        });
    });

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

    // Refuerzos periódicos
    setInterval(() => {
        patchCheckBlockedURL();
        patchForms();
        killMediafireModal();
    }, 500);

})();