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

Fix variable names and remove linter warnings

  • Loading branch information
Eden12345 committed Aug 2, 2019
commit 79257692d59426218bef1207aacc1d70eedca621
@@ -13,8 +13,6 @@

import React from 'react';
import Trackers from './Trackers';
import { CliqzFeature } from '../BuildingBlocks';
import Globals from '../../../../src/classes/Globals';

/**
* @class Implement Category component, which represents a
@@ -165,8 +163,6 @@ class Category extends React.Component {
category,
paused_blocking,
sitePolicy,
enable_anti_tracking,
actions,
isUnknown,
} = this.props;

@@ -185,17 +181,6 @@ class Category extends React.Component {
trackersBlockedCount = category.num_blocked || 0;
}

const clickCliqzFeature = (options) => {
const { feature, status, text } = options;
this.props.actions.showNotification({
updated: feature,
reload: true,
text,
});
actions.toggleCliqzFeature(feature, status);
};
const cliqzInactive = paused_blocking || sitePolicy || Globals.IS_CLIQZ;

return (
<div className={`${category.num_shown === 0 ? 'hide' : ''} blocking-category`}>
<div className={`sticky-category${this.state.showTooltip ? ' no-sticky' : ''}${isUnknown ? ' anti-tracking-header' : ''}`}>
@@ -51,7 +51,7 @@ class Policy {
return globals.BLACKLISTED;
}
if (this.checkSiteWhitelist(hostUrl)
|| this.checkAntiTrackingWhitelist(hostUrl, trackerUrl)) {
|| this.checkCliqzModuleWhitelist(hostUrl, trackerUrl)) {
return globals.WHITELISTED;
}
return false;
@@ -86,14 +86,14 @@ class Policy {
* @param {string} url site url
* @return {string|boolean} corresponding whitelist entry or false, if none
*/
checkAntiTrackingWhitelist(hostUrl, trackerUrl) {
checkCliqzModuleWhitelist(hostUrl, trackerUrl) {
let isWhitelisted = false;
const processedHostUrl = processUrl(hostUrl).host;
const processedTrackerUrl = processUrl(trackerUrl).host;
const antiTrackingWhitelist = conf.cliqz_module_whitelist;
const cliqzModuleWhitelist = conf.cliqz_module_whitelist;

if (antiTrackingWhitelist[processedTrackerUrl]) {
antiTrackingWhitelist[processedTrackerUrl].hosts.some((host) => {
if (cliqzModuleWhitelist[processedTrackerUrl]) {
cliqzModuleWhitelist[processedTrackerUrl].hosts.some((host) => {
if (host === processedHostUrl) {
isWhitelisted = true;
return true;
ProTip! Use n and p to navigate between commits in a pull request.