Blur Sensitive Data on Speedtest.net

Blur IPs, host info, sponsor links/names, survey params on speedtest.com

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Blur Sensitive Data on Speedtest.net
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Blur IPs, host info, sponsor links/names, survey params on speedtest.com
// @match        https://www.speedtest.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const ipRegex = /\b\d{1,3}(?:\.\d{1,3}){3}\b/;
    const blurStyle = 'filter: blur(12px) !important; user-select: none !important; pointer-events: none !important;';

    function blurSensitive() {
        // blur IPs and labels
        document.querySelectorAll('.result-data').forEach(el => {
            if (ipRegex.test(el.textContent)) {
                [el.previousElementSibling, el].forEach(e => {
                    if (e) e.style.cssText += blurStyle;
                });
            }
        });
        // blur server-host blocks
        document.querySelectorAll('.result-item-host').forEach(host => {
            host.style.cssText += blurStyle;
        });
        // blur sponsor link text
        document.querySelectorAll('a.js-data-sponsor').forEach(a => {
            a.style.cssText += blurStyle;
        });
        // blur sponsor name divs
        document.querySelectorAll('div.result-data.js-sponsor-name').forEach(div => {
            div.style.cssText += blurStyle;
        });
        // blur survey parameter
        document.querySelectorAll('p.audience-survey-parameter').forEach(p => {
            p.style.cssText += blurStyle;
        });
    }

    blurSensitive();
    new MutationObserver(blurSensitive).observe(document.body, { childList: true, subtree: true });
})();