Show the number and the state of cookies installed by each services

This commit is contained in:
1002Studio 2015-01-09 13:55:30 +01:00
parent e7bbb85a42
commit 6f3cd58f7d
3 changed files with 83 additions and 75 deletions

View File

@ -233,6 +233,21 @@
width: auto; width: auto;
} }
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies {
color: #333;
font-size: 11px;
}
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies b {
color: darkgreen;
font-size: 11px;
}
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies s {
color: gray;
font-size: 11px;
}
#tarteaucitron #tarteaucitronFooter { #tarteaucitron #tarteaucitronFooter {
background: #f2f2f2; background: #f2f2f2;
border-top: 1px solid #eee; border-top: 1px solid #eee;

View File

@ -32,7 +32,6 @@ var tarteaucitron = {
pathToServices = cdn + 'tarteaucitron.services.js', pathToServices = cdn + 'tarteaucitron.services.js',
linkElement = document.createElement('link'), linkElement = document.createElement('link'),
defaults = { defaults = {
"grayArea": false,
"hashtag": '#tarteaucitron', "hashtag": '#tarteaucitron',
"highPrivacy": false, "highPrivacy": false,
"orientation": "top", "orientation": "top",
@ -147,6 +146,7 @@ var tarteaucitron = {
html += '<div id="' + service.key + 'Line" class="tarteaucitronLine">'; html += '<div id="' + service.key + 'Line" class="tarteaucitronLine">';
html += ' <div class="tarteaucitronName">'; html += ' <div class="tarteaucitronName">';
html += ' <b>' + service.name + '</b><br/>'; html += ' <b>' + service.name + '</b><br/>';
html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
html += ' <a href="' + service.uri + '" target="_blank">'; html += ' <a href="' + service.uri + '" target="_blank">';
html += ' ' + tarteaucitron.lang.more + ' : ' + service.uri.split('/')[2]; html += ' ' + tarteaucitron.lang.more + ' : ' + service.uri.split('/')[2];
html += ' </a>'; html += ' </a>';
@ -247,9 +247,7 @@ var tarteaucitron = {
tarteaucitron.state[service.key] = false; tarteaucitron.state[service.key] = false;
tarteaucitron.userInterface.color(service.key, false); tarteaucitron.userInterface.color(service.key, false);
} else if (!isResponded) { } else if (!isResponded) {
if (typeof service.grayJs === 'function' && defaults.grayArea === true) { if (typeof service.fallback === 'function') {
service.grayJs();
} else if (typeof service.fallback === 'function') {
service.fallback(); service.fallback();
} }
} }
@ -372,6 +370,19 @@ var tarteaucitron = {
if (nbPending === 0) { if (nbPending === 0) {
tarteaucitron.userInterface.closeAlert(); tarteaucitron.userInterface.closeAlert();
} }
if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
}
if (status === true) {
document.getElementById('tacCL' + key).innerHTML = '...';
setTimeout(function () {
tarteaucitron.cookie.checkCount(key);
}, 2500);
} else {
tarteaucitron.cookie.checkCount(key);
}
}, },
"openPanel": function () { "openPanel": function () {
"use strict"; "use strict";
@ -445,6 +456,33 @@ var tarteaucitron = {
document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
} }
},
"checkCount": function (key) {
"use strict";
var arr = tarteaucitron.services[key].cookies,
nb = arr.length,
html = nb + ' cookie',
i;
if (nb > 1) {
html += 's';
}
if (nb > 0) {
html += ' [';
for (i = 0; i < nb; i += 1) {
if (document.cookie.indexOf(arr[i] + '=') !== -1) {
html += '<b>' + arr[i] + '</b> ';
} else {
html += '<s>' + arr[i] + '</s> ';
}
}
html += ']';
}
document.getElementById('tacCL' + key).innerHTML = html;
} }
}, },
"getLanguage": function () { "getLanguage": function () {

View File

@ -8,6 +8,7 @@ tarteaucitron.services.addthis = {
"name": "AddThis", "name": "AddThis",
"uri": "http://www.addthis.com/privacy/privacy-policy#publisher-visitors", "uri": "http://www.addthis.com/privacy/privacy-policy#publisher-visitors",
"needConsent": true, "needConsent": true,
"cookies": ['__atuvc', '__atuvs'],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.addthisPubId === undefined) { if (tarteaucitron.user.addthisPubId === undefined) {
@ -18,10 +19,7 @@ tarteaucitron.services.addthis = {
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var cookies = ['__atuvc', '__atuvs'], var id = 'addthis';
id = 'addthis';
tarteaucitron.cookie.purge(cookies);
tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id)); tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id));
} }
}; };
@ -33,6 +31,7 @@ tarteaucitron.services.alexa = {
"name": "Alexa", "name": "Alexa",
"uri": "http://www.alexa.com/help/privacy", "uri": "http://www.alexa.com/help/privacy",
"needConsent": true, "needConsent": true,
"cookies": ['__asc', '__auc'],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.alexaAccountID === undefined) { if (tarteaucitron.user.alexaAccountID === undefined) {
@ -44,11 +43,6 @@ tarteaucitron.services.alexa = {
dynamic: true dynamic: true
}; };
tarteaucitron.addScript('https://d31qbv1cthcecs.cloudfront.net/atrk.js'); tarteaucitron.addScript('https://d31qbv1cthcecs.cloudfront.net/atrk.js');
},
"fallback": function () {
"use strict";
var cookies = ['__asc', '__auc'];
tarteaucitron.cookie.purge(cookies);
} }
}; };
@ -59,6 +53,7 @@ tarteaucitron.services.clicky = {
"name": "Clicky", "name": "Clicky",
"uri": "https://clicky.com/terms", "uri": "https://clicky.com/terms",
"needConsent": true, "needConsent": true,
"cookies": ['_jsuid', '_eventqueue', '_referrer_og', '_utm_og', '_first_pageview', 'clicky_olark', 'no_trackyy_' + tarteaucitron.user.clickyId, 'unpoco_' + tarteaucitron.user.clickyId, 'heatmaps_g2g_' + tarteaucitron.user.clickyId],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.clickyId === undefined) { if (tarteaucitron.user.clickyId === undefined) {
@ -72,11 +67,6 @@ tarteaucitron.services.clicky = {
tarteaucitron.user.clickyMore(); tarteaucitron.user.clickyMore();
} }
}); });
},
"fallback": function () {
"use strict";
var cookies = ['_jsuid', '_eventqueue', '_referrer_og', '_utm_og', '_first_pageview', 'clicky_olark', 'no_trackyy_' + tarteaucitron.user.clickyId, 'unpoco_' + tarteaucitron.user.clickyId, 'heatmaps_g2g_' + tarteaucitron.user.clickyId];
tarteaucitron.cookie.purge(cookies);
} }
}; };
@ -87,6 +77,7 @@ tarteaucitron.services.dailymotion = {
"name": "Dailymotion", "name": "Dailymotion",
"uri": "http://www.dailymotion.com/legal/privacy", "uri": "http://www.dailymotion.com/legal/privacy",
"needConsent": true, "needConsent": true,
"cookies": ['ts', 'dmvk', 'hist', 'v1st', 's_vi'],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['dailymotion_player'], function (x) { tarteaucitron.fallback(['dailymotion_player'], function (x) {
@ -116,9 +107,7 @@ tarteaucitron.services.dailymotion = {
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var cookies = ['ts', 'dmvk', 'hist', 'v1st', 's_vi'], var id = 'dailymotion';
id = 'dailymotion';
tarteaucitron.cookie.purge(cookies);
tarteaucitron.fallback(['dailymotion_player'], tarteaucitron.engage(id)); tarteaucitron.fallback(['dailymotion_player'], tarteaucitron.engage(id));
} }
}; };
@ -130,6 +119,7 @@ tarteaucitron.services.disqus = {
"name": "Disqus", "name": "Disqus",
"uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy", "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.disqusShortname === undefined) { if (tarteaucitron.user.disqusShortname === undefined) {
@ -155,6 +145,7 @@ tarteaucitron.services.facebook = {
"name": "Facebook", "name": "Facebook",
"uri": "https://www.facebook.com/help/cookies/", "uri": "https://www.facebook.com/help/cookies/",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['fb-like'], ''); tarteaucitron.fallback(['fb-like'], '');
@ -173,6 +164,7 @@ tarteaucitron.services.ferank = {
"name": "FERank", "name": "FERank",
"uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience", "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
"needConsent": false, "needConsent": false,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () { tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
@ -190,6 +182,7 @@ tarteaucitron.services.gplus = {
"name": "Google+", "name": "Google+",
"uri": "http://www.google.fr/intl/policies/privacy/", "uri": "http://www.google.fr/intl/policies/privacy/",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.addScript('https://apis.google.com/js/platform.js'); tarteaucitron.addScript('https://apis.google.com/js/platform.js');
@ -207,6 +200,7 @@ tarteaucitron.services.adsense = {
"name": "Adsense (Google)", "name": "Adsense (Google)",
"uri": "http://www.google.com/ads/preferences/", "uri": "http://www.google.com/ads/preferences/",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'); tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
@ -214,7 +208,6 @@ tarteaucitron.services.adsense = {
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var id = 'adsense'; var id = 'adsense';
tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id)); tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
} }
}; };
@ -226,6 +219,7 @@ tarteaucitron.services.gajs = {
"name": "Google Analytics (ga.js)", "name": "Google Analytics (ga.js)",
"uri": "https://support.google.com/analytics/answer/6004245", "uri": "https://support.google.com/analytics/answer/6004245",
"needConsent": true, "needConsent": true,
"cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
"js": function () { "js": function () {
"use strict"; "use strict";
window._gaq = window._gaq || []; window._gaq = window._gaq || [];
@ -237,11 +231,6 @@ tarteaucitron.services.gajs = {
tarteaucitron.user.gajsMore(); tarteaucitron.user.gajsMore();
} }
}); });
},
"fallback": function () {
"use strict";
var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
tarteaucitron.cookie.purge(cookies);
} }
}; };
@ -252,6 +241,7 @@ tarteaucitron.services.analytics = {
"name": "Google Analytics (universal)", "name": "Google Analytics (universal)",
"uri": "https://support.google.com/analytics/answer/6004245", "uri": "https://support.google.com/analytics/answer/6004245",
"needConsent": true, "needConsent": true,
"cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
"js": function () { "js": function () {
"use strict"; "use strict";
window.GoogleAnalyticsObject = 'ga'; window.GoogleAnalyticsObject = 'ga';
@ -268,30 +258,6 @@ tarteaucitron.services.analytics = {
tarteaucitron.user.analyticsMore(); tarteaucitron.user.analyticsMore();
} }
}); });
},
"grayJs": function () {
"use strict";
window.GoogleAnalyticsObject = 'ga';
window.ga = window.ga || function () {
window.ga.q = window.ga.q || [];
window.ga.q.push(arguments);
};
window.ga.l = new Date();
tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 86400});
ga('set', 'anonymizeIp', true);
ga('set', 'forceSSL', true);
ga('send', 'pageview');
if (typeof tarteaucitron.user.analyticsMore === 'function') {
tarteaucitron.user.analyticsMore();
}
});
},
"fallback": function () {
"use strict";
var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
tarteaucitron.cookie.purge(cookies);
} }
}; };
@ -302,6 +268,7 @@ tarteaucitron.services.linkedin = {
"name": "Linkedin", "name": "Linkedin",
"uri": "https://www.linkedin.com/legal/cookie_policy", "uri": "https://www.linkedin.com/legal/cookie_policy",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['tacLinkedin'], ''); tarteaucitron.fallback(['tacLinkedin'], '');
@ -320,6 +287,7 @@ tarteaucitron.services.pinterest = {
"name": "Pinterest", "name": "Pinterest",
"uri": "https://about.pinterest.com/privacy-policy", "uri": "https://about.pinterest.com/privacy-policy",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js'); tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
@ -333,6 +301,7 @@ tarteaucitron.services.shareaholic = {
"name": "Shareaholic", "name": "Shareaholic",
"uri": "https://shareaholic.com/privacy/choices", "uri": "https://shareaholic.com/privacy/choices",
"needConsent": true, "needConsent": true,
"cookies": ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.shareaholicSiteId === undefined) { if (tarteaucitron.user.shareaholicSiteId === undefined) {
@ -348,10 +317,7 @@ tarteaucitron.services.shareaholic = {
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var cookies = ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'], var id = 'shareaholic';
id = 'shareaholic';
tarteaucitron.cookie.purge(cookies);
tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id)); tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
} }
}; };
@ -363,6 +329,7 @@ tarteaucitron.services.sharethis = {
"name": "ShareThis", "name": "ShareThis",
"uri": "http://www.sharethis.com/legal/privacy/", "uri": "http://www.sharethis.com/legal/privacy/",
"needConsent": true, "needConsent": true,
"cookies": ['__unam'],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.sharethisPublisher === undefined) { if (tarteaucitron.user.sharethisPublisher === undefined) {
@ -378,10 +345,7 @@ tarteaucitron.services.sharethis = {
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var cookies = ['__unam'], var id = 'sharethis';
id = 'sharethis';
tarteaucitron.cookie.purge(cookies);
tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id)); tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
} }
}; };
@ -393,6 +357,7 @@ tarteaucitron.services.twitter = {
"name": "Twitter", "name": "Twitter",
"uri": "https://support.twitter.com/articles/20170514", "uri": "https://support.twitter.com/articles/20170514",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['tacTwitter'], ''); tarteaucitron.fallback(['tacTwitter'], '');
@ -411,6 +376,7 @@ tarteaucitron.services.vimeo = {
"name": "Vimeo", "name": "Vimeo",
"uri": "http://vimeo.com/privacy", "uri": "http://vimeo.com/privacy",
"needConsent": true, "needConsent": true,
"cookies": ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['vimeo_player'], function (x) { tarteaucitron.fallback(['vimeo_player'], function (x) {
@ -440,9 +406,7 @@ tarteaucitron.services.vimeo = {
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var cookies = ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'], var id = 'vimeo';
id = 'vimeo';
tarteaucitron.cookie.purge(cookies);
tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id)); tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id));
} }
}; };
@ -454,6 +418,7 @@ tarteaucitron.services.xiti = {
"name": "Xiti", "name": "Xiti",
"uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/", "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
"needConsent": true, "needConsent": true,
"cookies": [],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.xitiId === undefined) { if (tarteaucitron.user.xitiId === undefined) {
@ -485,11 +450,6 @@ tarteaucitron.services.xiti = {
if (typeof tarteaucitron.user.xitiMore === 'function') { if (typeof tarteaucitron.user.xitiMore === 'function') {
tarteaucitron.user.xitiMore(); tarteaucitron.user.xitiMore();
} }
},
"fallback": function () {
"use strict";
var cookies = [''];
tarteaucitron.cookie.purge(cookies);
} }
}; };
@ -500,6 +460,7 @@ tarteaucitron.services.youtube = {
"name": "YouTube", "name": "YouTube",
"uri": "https://www.google.fr/intl/fr/policies/privacy/", "uri": "https://www.google.fr/intl/fr/policies/privacy/",
"needConsent": true, "needConsent": true,
"cookies": ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
"js": function () { "js": function () {
"use strict"; "use strict";
tarteaucitron.fallback(['youtube_player'], function (x) { tarteaucitron.fallback(['youtube_player'], function (x) {
@ -529,9 +490,7 @@ tarteaucitron.services.youtube = {
}, },
"fallback": function () { "fallback": function () {
"use strict"; "use strict";
var cookies = ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'], var id = 'youtube';
id = 'youtube';
tarteaucitron.cookie.purge(cookies);
tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id)); tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
} }
}; };
@ -543,16 +502,12 @@ tarteaucitron.services.zopim = {
"name": "Zopim", "name": "Zopim",
"uri": "https://www.zopim.com/privacy", "uri": "https://www.zopim.com/privacy",
"needConsent": true, "needConsent": true,
"cookies": ['__zlcid', '__zprivacy'],
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.zopimID === undefined) { if (tarteaucitron.user.zopimID === undefined) {
return; return;
} }
tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID); tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
},
"fallback": function () {
"use strict";
var cookies = ['__zlcid', '__zprivacy'];
tarteaucitron.cookie.purge(cookies);
} }
}; };