Hide IP Address

Hide your IP Address on speedtest.net!

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Hide IP Address
// @namespace    https://greatest.deepsurf.us/users/831955
// @version      0.1
// @description  Hide your IP Address on speedtest.net!
// @author       DanPlayz0
// @match        https://www.speedtest.net/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=speedtest.net
// @grant        none
// @license      MIT
// ==/UserScript==

(async function () {
  'use strict';
  function waitForElm(selector) {
    return new Promise(resolve => {
      if (document.querySelector(selector)) {
        return resolve(document.querySelector(selector));
      }

      const observer = new MutationObserver(mutations => {
        if (document.querySelector(selector)) {
          resolve(document.querySelector(selector));
          observer.disconnect();
        }
      });

      observer.observe(document.body, {
        childList: true,
        subtree: true
      });
    });
  }
  await waitForElm(".ispComponent .result-data");
  let ipAddress = document.querySelector(".ispComponent .result-data").innerText;

  document.addEventListener('click', (e) => {
    if (e.srcElement.id == "ip-reveal-btn") {
      e.srcElement.parentNode.className += " ip-revealed";
      e.srcElement.parentNode.innerHTML = ipAddress;
    }
  });

  setInterval(() => {
    const ispComponentIP = document.querySelector(".ispComponent .result-data");
    if (ispComponentIP && !ispComponentIP.className.includes("ip-revealed") && ispComponentIP.innerText.includes(ipAddress)) {
      ispComponentIP.innerHTML = '<a id="ip-reveal-btn">Click to reveal</a>';
    }

    const resultDataIP = document.querySelector(".js-data-ip");
    if (resultDataIP && !resultDataIP.className.includes("ip-revealed") && resultDataIP.innerText.includes(ipAddress)) {
      resultDataIP.innerHTML = '<a id="ip-reveal-btn">Click to reveal</a>';
    }
  }, 10);
})();