myrealvida.monkey

Facilite sua vida ao acessar https://myrealvida.pt/ com este script para Greasemonkey ou Tampermonkey!.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

// ==UserScript==
// @name         myrealvida.monkey
// @namespace    https://github.com/lucascudo/myrealvida.monkey
// @version      1.0
// @description  Facilite sua vida ao acessar https://myrealvida.pt/ com este script para Greasemonkey ou Tampermonkey!.
// @author       https://github.com/lucascudo
// @match        https://myrealvida.pt/resgates/ResgatesFinanceiros
// @match        https://myrealvida.pt/seguros/capitalizacao
// @grant        none
// ==/UserScript==

(function() {
    let total = 0;
    setInterval(() => Array.from(document.querySelectorAll(".movimentos-item")).reverse().forEach((movimento, idx, array) => {
        if (movimento.children.length > 2) {
            return;
        }
        let value = parseFloat(movimento.children[1].children[0].innerText.replace('€', '').replace(',', '.').trim());
        let op = movimento.children[1].children[1].classList[3];
        if (op === 'positivo') {
            total += value;
        } else if (op === 'negativo') {
            total -= value;
        }
        const subtotal = document.createElement('div');
        subtotal.innerHTML = '<b>' + total.toFixed(2).toString().replace('.', ',') + ' €</b>';
        subtotal.className = 'col-xs-4 col-sm-3 text-right';
        movimento.appendChild(subtotal);
        const header = document.querySelector('.movimentos-header');
        if (idx === array.length - 1 && header.children.length === 2) {
            const title = document.createElement('div');
            title.innerText = 'SUBTOTAL';
            title.className = 'col-xs-4 col-sm-3 movimento-valor';
            header.appendChild(title);
        }
    }), 3000);
})();