Skip to content

Commit

Permalink
Add an option to always needConsent Fix #1225
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauriC committed May 16, 2024
1 parent 9f8173c commit abfa89d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ tarteaucitron.init({
"DenyAllCta" : true, /* Show the deny all button */
"AcceptAllCta" : true, /* Show the accept all button when highPrivacy on */
"highPrivacy": true, /* HIGHLY RECOMMANDED Disable auto consent */
"alwaysNeedConsent": false, /* Ask the consent for "Privacy by design" services */
"handleBrowserDNTRequest": false, /* If Do Not Track == 1, disallow all */
"removeCredit": false, /* Remove credit link */
Expand Down
12 changes: 9 additions & 3 deletions tarteaucitron.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ var tarteaucitron = {
"groupServices": false,
"serviceDefaultState": 'wait',
"googleConsentMode": true,
"partnersList": false
"partnersList": false,
"alwaysNeedConsent": false
},
params = tarteaucitron.parameters;

Expand Down Expand Up @@ -1000,8 +1001,13 @@ var tarteaucitron = {
"use strict";
var html = '',
s = tarteaucitron.services,
service = s[serviceId],
cookie = tarteaucitron.cookie.read(),
service = s[serviceId];

if (tarteaucitron.parameters.alwaysNeedConsent === true) {
service.needConsent = true;
}

var cookie = tarteaucitron.cookie.read(),
hostname = document.location.hostname,
hostRef = document.referrer.split('/')[2],
isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
Expand Down
2 changes: 1 addition & 1 deletion tarteaucitron.min.js

Large diffs are not rendered by default.

0 comments on commit abfa89d

Please sign in to comment.