Mail recievers

Adds recievers to your mail inbox

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Mail recievers
// @namespace    http://tampermonkey.net/
// @version      2024-11-03
// @description  Adds recievers to your mail inbox
// @author       You
// @match        https://www.warzone.com/Discussion/MyMail*
// @grant        none
// ==/UserScript==

(function() {
    let rows = document.getElementsByClassName("region")[0].tBodies[0].rows;
    for (let row of Array.from(rows).slice(1)) {
        processRow(row);
    }

    async function processRow(row) {
        let children = row.cells[0].children;
        if (children) {
            let url = children[0].href;
            let toLine = "\nsend to: " + await getNames(url);
            children[2].innerText += toLine;
        }
    }

    async function getNames(url) {
        let parser = new DOMParser();
        let names = [];
        let doc = await fetch(url).then(reply => reply.text()).then(text => parser.parseFromString(text, 'text/html'));
        let cell = doc.getElementsByTagName("Table")[0].rows[0].cells[0];
        for (let child of Array.from(cell.children).slice(2)){
            if (child.tagName == "BR") break;
            names.push(child.innerText.trim());
        }
        return names.join(", ");
    }
})();