Hide IP and ISP - speedtest.net

This script hides all elements which indicate to people what your IP or ISP is, as well as the location/sponsor.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Hide IP and ISP - speedtest.net
// @namespace   Violentmonkey Scripts
// @match       *://www.speedtest.net/*
// @grant       none
// @license     GNU GPLv3
// @version     1.03
// @author      doge2018
// @description This script hides all elements which indicate to people what your IP or ISP is, as well as the location/sponsor.
// ==/UserScript==


// Create effect class
class Effect {
  constructor(name, value) {
    this.name = name;
    this.value = value;
  }
  
  get css() {
    return `${this.name}: ${this.value};`;
  }
}

// Variables
var classes = ["js-sponsor-name", "js-data-sponsor", "js-data-isp", "js-data-ip", "ispComponent", "server-current"];
var effects = [new Effect("filter", "blur(8px)")];
var css = "<style>";

// Generate CSS classnames
var classNameIndex = 0;
classes.forEach(className => {
  if (classNameIndex < classes.length - 1)
    css += `.${className}, `;
  else
    css += `.${className} {`;
  
  classNameIndex++;
});

// Generate CSS content/filter
effects.forEach(effect => {
  effect = effect.css;
  css += `\n${effect}`;
});

// Finish CSS
css += "\n}</style>";

// Apply CSS override
document.body.insertAdjacentHTML("afterbegin", css);