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

GH-1798: Update Unknown category to include Ad Blocker unknowns #433

Merged
merged 10 commits into from Aug 2, 2019
Next

Use total trackers displayed for tracker count, rather than all modif…

…ied requests
  • Loading branch information
Eden12345 committed Jul 31, 2019
commit 2a0a3eac94364254453184a339a94634082ac675
@@ -340,9 +340,9 @@ class Summary extends React.Component {
}

_totalTrackersFound() {
const { trackerCounts } = this.props;
const { trackerCounts, antiTracking } = this.props;

return (trackerCounts.allowed + trackerCounts.blocked + this._requestsModifiedCount()) || 0;
return (trackerCounts.allowed + trackerCounts.blocked + antiTracking.unknownTrackerCount) || 0;
}

_requestsModifiedCount() {
@@ -40,6 +40,10 @@ const initialState = {
totalUnsafeCount: 0, // The amount of data points scrubbed by Anti-Tracking
totalUnknownCount: 0, // The amount of data points scrubbed by Anti-Tracking for Trackers not in the Ghostery DB
unknownTrackerCount: 0, // The amount of trackers blocked by Anti-Tracking
},
adBlock: {
totalCount: 0, // The amount of ads blocked by Ad Blocking
trackerCount: 0, // The amount of trackers blocked by Ad Blocking (which are each associated with 1 or more ads)
}
};
/**
@@ -99,13 +99,25 @@ export function getCliqzAntiTrackingData(tabId, tabHostUrl) {
export function getCliqzAdBlockingCount(tabId) {
if (!conf.enable_ad_block || !adblocker.background) {
return {
totalCount: 0
totalCount: 0,
trackerCount: 0,
};
}

const adBlockInfo = adblocker.background.actions.getAdBlockInfoForTab(tabId);

if (!adBlockInfo) {
return {
totalCount: 0,
trackerCount: 0,
};
}

console.log('~~~sawgferw~~~', adBlockInfo)

return {
totalCount: adBlockInfo.totalCount || 0,
totalCount: adBlockInfo.totalCount,
trackerCount: Object.keys(adBlockInfo.advertisersList).length,
};
}

ProTip! Use n and p to navigate between commits in a pull request.