Verified Commit ac136556 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

fix issue with FF

parent d92f021b
......@@ -85,28 +85,30 @@ $( document ).ready(function() {
});
/* default mechanism */
dnt = false;
if (window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack || ('external' in window && 'msTrackingProtectionEnabled' in window.external)) {
if (window.doNotTrack == "1" || navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1" || ('external' in window && 'msTrackingPronectionEnabled' in window.external && window.external.msTrackingProtectionEnabled())) {
/* Do Not Track is enabled => stop */
jQuery('.lap-cookies-accept, .lap-cookies-refuse').addClass('disabled');
/* Do Not Track is enabled => stop */
jQuery('.lap-cookies-accept, .lap-cookies-refuse').addClass('disabled');
dnt = true;
}
} else {
}
if (dnt == false) {
// get the indicator cookie
var lapCookieAgree = '';
var name = 'lap_cookie_agree=';
var cookieArray = decodeURIComponent(document.cookie).split('; ');
cookieArray.forEach(cookie => {
if (cookie.indexOf(name) == 0) {
lapCookieAgree = parseInt(cookie.substring(name.length, cookie.length));
lapCookieAgree = cookie.substring(name.length, cookie.length);
}
});
// logic
if (lapCookieAgree == 0) {
if (lapCookieAgree == '0') {
/* visitor refused cookies => remove Matomo trace if present */
jQuery('.lap-cookies-refuse').addClass('disabled');
clearCookies();
} else if (lapCookieAgree == 1) {
} else if (lapCookieAgree == '1') {
/* visitor accepted cookies => load Matomo */
jQuery('.lap-cookies-accept').addClass('disabled');
loadMatomo();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment