Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add disable finger print options #18599

Merged
merged 20 commits into from
Jan 17, 2022
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ plugins/*/javascripts/
plugins/*/angularjs/
plugins/*/tests/UI/
plugins/*/vue/dist/**/*.js
js/*.js
piwik.js
23 changes: 16 additions & 7 deletions js/piwik.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"", "\b", "\t", "\n", "\f", "\r", "\"", "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length, parse, prototype, push, replace,
sort, slice, stringify, test, toJSON, toString, valueOf, objectToJSON, addTracker, removeAllAsyncTrackersButFirst,
optUserOut, forgetUserOptOut, isUserOptedOut, withCredentials, visibilityState
optUserOut, forgetUserOptOut, isUserOptedOut, withCredentials, visibilityState, disableFingerPrint
*/
/*global _paq:true */
/*members push */
Expand Down Expand Up @@ -2439,7 +2439,9 @@ if (typeof window.Matomo !== 'object') {
uniqueTrackerId = trackerIdCounter++,

// whether a tracking request has been sent yet during this page view
hasSentTrackingRequestYet = false;
hasSentTrackingRequestYet = false,

fingerPrintEnable = true;
peterhashair marked this conversation as resolved.
Show resolved Hide resolved

// Document title
try {
Expand Down Expand Up @@ -3749,11 +3751,14 @@ if (typeof window.Matomo !== 'object') {
(charSet ? '&cs=' + encodeWrapper(charSet) : '') +
'&send_image=0';

var browserFeatures = detectBrowserFeatures();
// browser features
for (i in browserFeatures) {
if (Object.prototype.hasOwnProperty.call(browserFeatures, i)) {
request += '&' + i + '=' + browserFeatures[i];
//Browser FingerPrint
if(fingerPrintEnable) {
var browserFeatures = detectBrowserFeatures();
peterhashair marked this conversation as resolved.
Show resolved Hide resolved
// browser features
for (i in browserFeatures) {
if (Object.prototype.hasOwnProperty.call(browserFeatures, i)) {
request += '&' + i + '=' + browserFeatures[i];
}
}
}

Expand Down Expand Up @@ -4960,6 +4965,10 @@ if (typeof window.Matomo !== 'object') {
linkTrackingInstalled = false;
linkTrackingEnabled = false;
};
this.disableFingerPrint = function ()
peterhashair marked this conversation as resolved.
Show resolved Hide resolved
{
fingerPrintEnable = false;
peterhashair marked this conversation as resolved.
Show resolved Hide resolved
};
this.getConfigVisitorCookieTimeout = function () {
return configVisitorCookieTimeout;
};
Expand Down