Mail.com Helper

Quality of life changes to Mail.com

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Mail.com Helper
// @namespace    ccn0
// @version      3
// @description  Quality of life changes to Mail.com
// @author       CCN0
// @license      MIT
// @match        *://*.mail.com/*
// @icon         https://s.uicdn.com/mailint/1.0.0/assets/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    function mailMailMailMail() {
        function removeElements(selector) {
            const elements = document.querySelectorAll(selector);
            elements.forEach(element => {
                element.remove();
            });
        };
        function fullScreenButtonButGood() { /*add this to the main thing if you want to use it, but it throws errors bc its always checking*/
            const fullscreenbutton = document.getElementById('fullscreen');
            fullscreenbutton.id = "";
            fullscreenbutton.setAttribute("onclick","document.getElementById('mail-detail').requestFullscreen()");
        }

        removeElements('[data-test^="actions-menu__item-premiummail"]');
        removeElements('[data-test^="actions-menu__item-games"]');
        removeElements('[data-test^="actions-menu__item-cloud"]');
        removeElements('[data-test^="actions-menu__item-ooeditor"]');
        removeElements('[data-test^="actions-menu__item-mailcheck"]');
        removeElements('[data-test^="actions-menu__item-blog"]');
        removeElements('[title^="Upgrade to mail.com Premium"]');
        removeElements('li[title^="Increase cloud storage"]');
        removeElements('[data-area^="features"]');
        removeElements('.search.widget');
        removeElements('.native-content-box-ad__iframe'); /*idk why ad block doesnt work*/
        removeElements('.ad');
        removeElements(`.piba-compact`);

        const links = document.querySelectorAll('a[href*="://deref-mail.com"]');

        links.forEach(function(link) {
            var originalHref = link.getAttribute('href');

            var url = new URL(originalHref);
            var redirectUrl = url.searchParams.get('redirectUrl');

            var decodedRedirectUrl = decodeURIComponent(redirectUrl);

            link.setAttribute('href', decodedRedirectUrl);
        });
    };
    setInterval(mailMailMailMail, 250);
})();