IP Masker

Simply Hides your IP Address!

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

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

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         IP Masker
// @namespace    Violentmonkey Scripts
// @version      1.0
// @description  Simply Hides your IP Address!
// @match        https://www.myedio.com/*
// @grant        GM.setValue
// @grant        GM.getValue
// @grant        GM.deleteValue
// @license      CC BY-NC
// @author       Unknown Hacker
// ==/UserScript==

(function() {
    'use strict';

    const ipRegex = /\b((?:\d{1,3}\.){3}\d{1,3}|\b(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\b)\b/g;

    function processElements() {
        const elements = document.querySelectorAll('p');

        elements.forEach(async function(el, index) {
            if (el.dataset.processed) {
                return;
            }

            const text = el.textContent.trim();

            if (ipRegex.test(text)) {
                const key = `ip_${index}`;
                await GM.setValue(key, text);

                el.textContent = 'Click to view IP';
                el.style.cursor = 'pointer';
                el.style.color = 'blue';
                el.style.textDecoration = 'underline';

                el.dataset.processed = 'true';

                el.addEventListener('click', async function() {
                    if (el.textContent !== 'Click to view IP') {
                        return;
                    }

                    const ip = await GM.getValue(key);
                    el.textContent = ip;

                    await GM.deleteValue(key);

                    el.style.color = '';
                    el.style.textDecoration = '';
                    el.style.cursor = '';
                });
            }
        });
    }

    const observer = new MutationObserver((mutations) => {
        mutations.forEach(() => {
            processElements();
        });
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    processElements();
})();