Remover

Con questo script puoi modificare qualsiasi sito web.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name            Remover
// @name:de         Remover
// @name:fr         Remover
// @name:es         Remover
// @name:it         Remover
// @name:pt         Remover
// @name:ru         Remover
// @name:ja         Remover
// @name:zh         Remover
// @description     With this Script you can edit every Website.
// @description:de  Mit diesem Skript können sie jede beliebige Website bearbeiten.
// @description:fr  Avec ce script, vous pouvez modifier n'importe quel site Web.
// @description:es  Con este script puedes editar cualquier sitio web.
// @description:it  Con questo script puoi modificare qualsiasi sito web.
// @description:pt  Com este script você pode editar qualquer site.
// @description:ru  С помощью этого скрипта вы можете редактировать любой веб-сайт.
// @description:ja  このスクリプトを使用すると、すべての Web サイトを編集できます。
// @description:zh  使用此脚本,您可以编辑每个网站。
// @version         5.2.1.3
// @author          Wack.3gp (https://greasyfork.org/users/4792)
// @copyright       2013+, Wack.3gp
// @namespace       https://greasyfork.org/users/4792
// @license         CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
//
// @match           *://*/*
// @noframes
// @priority        9999
//
// @grant           GM_notification
// @grant           GM_registerMenuCommand
// @grant           GM_addStyle
//
// @compatible      Chrome tested with Tampermonkey
// @supportURL      https://greasyfork.org/scripts/4612/feedback
// @contributionURL https://www.paypal.com/donate/?hosted_button_id=BYW9D395KJWZ2
// @contributionAmount €1.00
// ==/UserScript==

/* jshint esversion: 9 */

(function() {
    'use strict';

    const _vault = "4792";
    const _isOriginal = GM_info.script.namespace.includes(_vault);
    const _originalURL = GM_info.script.supportURL.replace("feedback", "");

    GM_addStyle(`
        #remover-quick-actions {
            position: fixed; bottom: 20px; right: 20px; z-index: 10000;
            background: #222; color: #fff; padding: 15px; border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-family: sans-serif;
            display: flex; flex-direction: column; gap: 10px; border: 1px solid #444;
            animation: removerFadeIn 0.3s ease;
        }
        #remover-quick-actions b { color: #f44336; font-size: 14px; }
        .remover-btn {
            background: #444; color: white; border: none; padding: 8px 12px;
            border-radius: 4px; cursor: pointer; text-align: center; font-size: 13px;
            transition: background 0.2s;
        }
        .remover-btn:hover { background: #666; }
        .remover-btn.save { background: #f44336; }
        .remover-btn.save:hover { background: #d32f2f; }
        @keyframes removerFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    `);

    const checkProtection = () => {
        if (!_isOriginal) {
            alert("Please install the Original Version");
            window.location.href = _originalURL;
            return false;
        }
        return true;
    };

    const downloadPage = () => {
        if (!checkProtection()) return;

        const clone = document.documentElement.cloneNode(true);
        const uiElement = clone.querySelector('#remover-quick-actions');
        if (uiElement) uiElement.remove();

        const scripts = clone.querySelectorAll('script');
        scripts.forEach(s => s.remove());

        const htmlContent = clone.outerHTML;
        const blob = new Blob([htmlContent], { type: 'text/html' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = `Edited_${document.title.replace(/[/\\?%*:|"<>]/g, '-')}.html`;
        link.click();
        URL.revokeObjectURL(url);
    };

    const showQuickActions = () => {
        if (document.getElementById('remover-quick-actions')) return;

        const container = document.createElement('div');
        container.id = 'remover-quick-actions';
        container.innerHTML = `
            <b>Remover Session Finished</b>
            <button class="remover-btn save" id="remover-download">💾 Download as HTML</button>
            <button class="remover-btn" id="remover-close">✕ Close</button>
        `;
        document.body.appendChild(container);

        document.getElementById('remover-download').onclick = () => {
            downloadPage();
            container.remove();
        };
        document.getElementById('remover-close').onclick = () => container.remove();

        setTimeout(() => { if (document.body.contains(container)) container.remove(); }, 15000);
    };

    const toggleEditMode = () => {
        if (!checkProtection()) return;

        const isCurrentlyOff = (document.designMode === 'off' || document.designMode === '');
        
        if (isCurrentlyOff) {
            document.designMode = 'on';
            document.body.contentEditable = 'true';
            notifyUser("Edit Mode: ENABLED");
        } else {
            document.designMode = 'off';
            document.body.contentEditable = 'false';
            notifyUser("Edit Mode: DISABLED");
            showQuickActions();
        }
    };

    function notifyUser(message) {
        if (typeof GM_notification === 'function') {
            GM_notification({ title: GM_info.script.name, text: message, timeout: 2000 });
        }
    }

    GM_registerMenuCommand("🚀 Start/Stop Editing", toggleEditMode);
    GM_registerMenuCommand("💾 Direct Download HTML", downloadPage);
    
        GM_registerMenuCommand("☕ Buy Me a Coffee :)", function () {
alert("Hello, I'm " + GM_info.script.author + "\nand I wrote this script as a hobby.\nIf you find it useful, buy me a coffee :)");
    window.open(GM_info.script.header.match(/@contributionURL\s+(.+)/)[1], "_blank");
        });

    if (_isOriginal) {
        console.log(`%c ${GM_info.script.name} v${GM_info.script.version} %c (Verified Original)`, 
                    "background: #f44336; color: white; font-weight: bold; padding: 2px 5px;", "color: #f44336;");
    }

})();