Facebook's fbclid Killer

Get rid of Facebook's fbclid tracking

< Spätná väzba na Facebook's fbclid Killer

Hodnotenie: OK - skript funguje, ale má chyby

§
Pridaný: 05.10.2019

not works for middle click

the code below works for middle click

$(document).on("mousedown",'a', function (e1) {
    $(document).one("mouseup",'a', function (e2) {
        if (e1.which == 2 && e1.target == e2.target) {
            var fbLink = this.href;
            var index = fbLink.search(/fbclid/);
            if(index != -1){
                event.preventDefault();
                var originalLink = fbLink.substring(0, index-1);
                this.href = originalLink;
                var e3 = $.event.fix(e2);
                e3.type = "middleclick";
                $(e2.target).trigger(e3);
            }
        }
    });
});

then combine your original code

Pridať odpoveď

Aby ste mohli pridať odpoveď, prihláste sa.