PageSourceSearch

https://takismarakakis.com/catalog/view/javascript/do-not-track.js?v=14218c54

js takismarakakis.com collected 2026-10-06 12:53:21 UTC 5,204 bytes, 132 lines download raw bytes

1function doNotTrackMe()
2{
3    if (window.doNotTrack
4    || navigator.doNotTrack
5    || navigator.msDoNotTrack
6    || (typeof window.external !== "undefined" && 'msTrackingProtectionEnabled' in window.external)
7    ) {
8        if (window.doNotTrack == "1"
9        || navigator.doNotTrack == "yes"
10        || navigator.doNotTrack == "1"
11        || navigator.msDoNotTrack == "1"
12        || (typeof window.external.msTrackingProtectionEnabled === "function" && window.external.msTrackingProtectionEnabled())
13        ) {
14            return true; //enabled
15        } else {
16            return false;//disabled
17        }
18    } else {
19        return false;//not supported
20    }
21}
22
23$(window).on("load", function() {
24    //button-payment-method
25    ism_ajax_event();
26    //cookie consents
27    $('#ism-consent-box').show();
28    var source = document.getElementById('ism-consent-toggle');
29    var target = document.getElementById('ism-consent-placeholder');
30    if (target !== null) {
31        target.appendChild(source);
32        $('#ism-consent-toggle').show();
33    }
34
35    var buttons = document.querySelectorAll('#collapse-payment-method');
36     buttons.forEach(function(buttonScript) {
37         buttonScript.addEventListener('change', function() { ism_ajax_event('#collapse-payment-method'); }, { once : true })
38    });
39});
40
41function ism_ajax_event(button_id = '') {
42    $.ajax({
43        async: true,
44        type: 'post',
45        dataType: 'json',//use 'script' for single script return
46        url: 'index.php?route=extension/analytics/script_manager/index',
47        data: {ajax: 1, scriptmanager: 1, button: button_id},
48        success: function(data) {
49            var i;
50            if (data !== null) {
51                for (i = 0; i < data.length; i++) {
52                    (new Function(data[i]))()
53                }
54            }
55        }
56    });
57}
58
59function sm_consent(accept, suffix, duration) {
60    $('#ism-consent-box').hide();
61    $('#ism-consent-modal').hide();
62    var now = new Date();
63    now.setTime(now.getTime()+duration*86400000);
64    document.cookie = 'sm_consent'+suffix+'='+accept+'; expires='+now.toUTCString()+'; path=/; domain=.'+document.domain+'; SameSite=Strict; Secure;';
65    /*if (!accept) {//clear rejected cookies
66        sm_clear_cookies(cookieList);
67    }*/
68}
69
70function sm_clear_cookies(cookieList) {
71    var cookieNames = document.cookie.split(/=[^;]*(?:;\s*|$)/);
72    for (var i = 0; i < cookieNames.length; i++) {
73        cookieList.forEach(pattern => {//cookieList must be defined!
74            if (cookieNames[i].includes(pattern)) {
75                root_domain = document.domain.split('.').slice(-2).join('.');
76                document.cookie = cookieNames[i]+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=."+root_domain+";";
77                if (root_domain != document.domain) {
78                    document.cookie = cookieNames[i]+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=."+document.domain+";";
79                }
80            }
81        });
82    }
83}
84
85var addButtonChecker = {
86    'AddToCartProduct': function(product_id, quantity) {
87        var productDataAjax = $('#product input[type="text"], #product input[type="hidden"], #product input[type="radio"]:checked, #product input[type="checkbox"]:checked, #product select, #product textarea').serialize();
88        if (!productDataAjax) {
89            var productDataAjax = 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1);
90        }
91        $.ajax({
92            async: true,
93            url: 'index.php?route=checkout/cart/checkAddToCart',
94            type: 'post',
95            data: productDataAjax,
96            dataType: 'json',
97            success: function(jsonClickCheck) {
98                if ((typeof doNotTrackMe !== "function" || !doNotTrackMe()) && jsonClickCheck !== null && jsonClickCheck['AddToCart']!='') {
99                    (new Function(jsonClickCheck['AddToCart']))()
100                }
101            }
102        });
103    },
104    'AddToCart': function(product_id, quantity) {
105        $.ajax({
106            async: true,
107            url: 'index.php?route=checkout/cart/checkAddToCart',
108            type: 'post',
109            data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
110            dataType: 'json',
111            success: function(jsonClickCheck) {
112                if ((typeof doNotTrackMe !== "function" || !doNotTrackMe()) && jsonClickCheck !== null && jsonClickCheck['AddToCart']!='') {
113                    (new Function(jsonClickCheck['AddToCart']))()
114                }
115            }
116        });
117    },
118    'AddToWishlist': function(product_id, quantity) {
119        $.ajax({
120            async: true,
121            url: 'index.php?route=checkout/cart/checkAddToWishlist',
122            type: 'post',
123            data: 'product_id=' + product_id,
124            dataType: 'json',
125            success: function(jsonClickCheck) {
126                if ((typeof doNotTrackMe !== "function" || !doNotTrackMe()) && jsonClickCheck !== null && jsonClickCheck['AddToWishlist']!='') {
127                    (new Function(jsonClickCheck['AddToWishlist']))()
128                }
129            }
130        });
131    }
132}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.