Blur Sensitive Data on Speedtest.net

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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 यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

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

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

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

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

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

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

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

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

// ==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 });
})();