Do not track click link

try track me click on forum.dobreprogramy.pl, remove redirect.

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

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 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         Do not track click link 
// @description  try track me click on forum.dobreprogramy.pl, remove redirect.
// @match        https://forum.dobreprogramy.pl/
// @include      https://forum.dobreprogramy.pl/*
// @icon         https://i.imgur.com/aoGUAKi.png
// @homepageURL  https://greasyfork.org/pl/scripts/37660-do-not-track-click-link
// @version      1.1.2
// @author       krystian3w
// @run-at       document-idle
// @grant        none
// @compatible   firefox Firefox
// @compatible   chrome Chrome
// @compatible   edge Edge
// @compatible   opera Opera
// @compatible   safari Safari
// @namespace https://greasyfork.org/users/167625
// ==/UserScript==

(function() {
    'use strict';

    function addNoTrackLinks() {
        document.querySelectorAll('.regular.contents .cooked a[href*="//"], .regular.contents .cooked a[href^="/uploads/"], .excerpt a[href*="//"], .excerpt a[href^="/uploads/"]').forEach(function(link) {
            link.classList.add('no-track-link');
        });
    }

    window.addEventListener("DOMContentLoaded", addNoTrackLinks);

    const observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            mutation.addedNodes.forEach(function(node) {
                if (node.nodeType === 1 && node.tagName === 'A') {
                    addNoTrackLinks();
                }
            });
        });
    });

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

    document.body.addEventListener("mouseover", function(event) {
        if (event.target.tagName === 'A') {
            addNoTrackLinks();
        }
    });
})();