Greasy Fork is available in English.

Mail recievers

Adds recievers to your mail inbox

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 or Violentmonkey 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         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(", ");
    }
})();