Elimina el modal "servidores no autorizados" (detección errónea de MF) y permite publicar/editar normalmente.
// ==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);
})();