add option to enable DoNotTrackSupport support :

default : false
to enable add :
"handleBrowserDNTRequest": true /* Répondre au DoNotTrack du navigateur*/
to on page tarteaucitron.init script.
This commit is contained in:
eldk 2018-06-12 16:09:35 +02:00
parent 87d590e476
commit d20fe6798a
1 changed files with 4 additions and 2 deletions

View File

@ -183,7 +183,8 @@ var tarteaucitron = {
"orientation": "top", "orientation": "top",
"removeCredit": false, "removeCredit": false,
"showAlertSmall": true, "showAlertSmall": true,
"cookieslist": true "cookieslist": true,
"handleBrowserDNTRequest": false
}, },
params = tarteaucitron.parameters; params = tarteaucitron.parameters;
@ -196,6 +197,7 @@ var tarteaucitron = {
tarteaucitron.orientation = defaults.orientation; tarteaucitron.orientation = defaults.orientation;
tarteaucitron.hashtag = defaults.hashtag; tarteaucitron.hashtag = defaults.hashtag;
tarteaucitron.highPrivacy = defaults.highPrivacy; tarteaucitron.highPrivacy = defaults.highPrivacy;
tarteaucitron.handleBrowserDNTRequest = defaults.handleBrowserDNTRequest;
// Step 1: load css // Step 1: load css
linkElement.rel = 'stylesheet'; linkElement.rel = 'stylesheet';
@ -463,7 +465,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 && isDNTRequested) { } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
tarteaucitron.cookie.create(service.key, 'false'); tarteaucitron.cookie.create(service.key, 'false');
if (typeof service.fallback === 'function') { if (typeof service.fallback === 'function') {
service.fallback(); service.fallback();