Balance Randomizer

Randomizes balance values to over 1 million euros for April 1st, 2024

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         Balance Randomizer
// @namespace    http://brainhub24.com/
// @version      1.16
// @description  Randomizes balance values to over 1 million euros for April 1st, 2024
// @author       Jan Gebser (Brainhub24.com)
// @match        https://www.haspa.de/de/home/onlinebanking/nbf/finanzuebersicht.html*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Check if it's April 1st, 2024
    var today = new Date();
    if (today.getMonth() === 3 && today.getDate() === 1 && today.getFullYear() === 2024) {
        // Find all elements containing the balance value
        var balanceContainers = document.querySelectorAll('.mkp-currency-m');

        // Loop through each balance container and update the value
        balanceContainers.forEach(function(container) {
            // Get real balance value
            var realBalance = parseFloat(container.innerText.replace(',', '.'));

            // Generate a new balance value (over 1 million euros)
            var newBalance = Math.floor(Math.random() * 9000000) + 1000000; // Random value between 1 million and 10 million

            // Update the balance with the new value
            container.innerHTML = '<span aria-hidden="true" class="balance-predecimal">' + Math.floor(newBalance) + '</span><span aria-hidden="true" class="balance-decimal">,' + (newBalance % 100).toFixed(2).slice(-2) + '</span><span aria-hidden="false"> EUR</span>';
        });
    }
})();