diff --git a/CHANGELOG.md b/CHANGELOG.md
index 745c96af6..3d5589ff0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
### GHOSTERY 8.5.0 ()
+ New Spring themes for Plus subscribers (#525)
++ New settings option to select Ad-Blocker lists (#527)
+ Add password reset link to Intro Hub (#507)
+ Updated in-app promo modals (#509)
+ Fixes bug in site-specific tracker white-listing (#522, Fixes #519)
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 1b545417a..61aabdae7 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -806,6 +806,21 @@
"description": "Options page site whitelisting error message shown when whitelisting a URL that is already in the whitelist.",
"message": "This site is already whitelisted."
},
+ "settings_adblocker": {
+ "message": "Ad Block Lists"
+ },
+ "settings_adblocker_lists": {
+ "message": "Load the following Ad Block filter lists:"
+ },
+ "settings_adblocker_list_1": {
+ "message": "Ads only"
+ },
+ "settings_adblocker_list_2": {
+ "message": "Ads + Trackers"
+ },
+ "settings_adblocker_list_3": {
+ "message": "Ads + Trackers + Annoyances"
+ },
"settings_purple_box": {
"message": "Purple Box"
},
diff --git a/app/panel/components/Rewards.jsx b/app/panel/components/Rewards.jsx
index eab30434a..3b70cc19d 100644
--- a/app/panel/components/Rewards.jsx
+++ b/app/panel/components/Rewards.jsx
@@ -20,7 +20,7 @@ import { sendMessage } from '../utils/msg';
import globals from '../../../src/classes/Globals';
import { log } from '../../../src/utils/common';
-const IS_CLIQZ = (globals.BROWSER_INFO.name === 'cliqz');
+const { IS_CLIQZ } = globals;
/**
* @class The Rewards Panel shows offers generated by Ghostery Rewards.
diff --git a/app/panel/components/Settings.jsx b/app/panel/components/Settings.jsx
index 48884d790..52f528caa 100644
--- a/app/panel/components/Settings.jsx
+++ b/app/panel/components/Settings.jsx
@@ -17,6 +17,7 @@ import { Route } from 'react-router-dom';
import { sendMessage } from '../utils/msg';
import SettingsMenu from './Settings/SettingsMenu';
import GlobalBlocking from './Settings/GlobalBlocking';
+import AdBlocker from './Settings/AdBlocker';
import TrustAndRestrict from './Settings/TrustAndRestrict';
import GeneralSettings from './Settings/GeneralSettings';
import Notifications from './Settings/Notifications';
@@ -79,6 +80,8 @@ class Settings extends React.Component {
GeneralSettingsComponent = () => ();
+ AdBlockerComponent = () => ();
+
PurpleboxComponent = () => ();
NotificationsComponent = () => ();
@@ -165,6 +168,7 @@ class Settings extends React.Component {
+
diff --git a/app/panel/components/Settings/AdBlocker.jsx b/app/panel/components/Settings/AdBlocker.jsx
new file mode 100644
index 000000000..90e44a6c4
--- /dev/null
+++ b/app/panel/components/Settings/AdBlocker.jsx
@@ -0,0 +1,65 @@
+/**
+ * Ad Blocker Settings Component
+ *
+ * Ghostery Browser Extension
+ * https://www.ghostery.com/
+ *
+ * Copyright 2019 Ghostery, Inc. All rights reserved.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0
+ */
+
+import React from 'react';
+import PropTypes from 'prop-types';
+import { RadioButtonGroup } from '../BuildingBlocks';
+
+/**
+ * @class Implement Ad Blocker Settings subview as a React component.
+ * The view opens from the left-side menu of the main Settings view.
+ * It allows the user to choose their Ad Blocker filter lists.
+ * @memberOf SettingsComponents
+ */
+const AdBlocker = (props) => {
+ const { settingsData } = props;
+
+ const handleListSelection = (index) => {
+ props.actions.selectItem({
+ event: 'cliqz_adb_mode',
+ value: index,
+ });
+ };
+
+ return (
+
+
+
+
{ t('settings_adblocker') }
+ { t('settings_adblocker_lists') }
+
+
+
+
+ );
+};
+
+AdBlocker.propTypes = {
+ settingsData: PropTypes.shape({
+ cliqz_adb_mode: PropTypes.number,
+ }),
+ actions: PropTypes.shape({
+ selectItem: PropTypes.func.isRequired,
+ }).isRequired,
+};
+AdBlocker.defaultProps = {
+ settingsData: {
+ cliqz_adb_mode: 0,
+ },
+};
+
+export default AdBlocker;
diff --git a/app/panel/components/Settings/OptIn.jsx b/app/panel/components/Settings/OptIn.jsx
index a2da92c2e..04598f99f 100644
--- a/app/panel/components/Settings/OptIn.jsx
+++ b/app/panel/components/Settings/OptIn.jsx
@@ -14,7 +14,7 @@
import React from 'react';
import globals from '../../../../src/classes/Globals';
-const IS_CLIQZ = (globals.BROWSER_INFO.name === 'cliqz');
+const { IS_CLIQZ } = globals;
/**
* @class Implement Opt In subview as a React component.
diff --git a/app/panel/components/Settings/SettingsMenu.jsx b/app/panel/components/Settings/SettingsMenu.jsx
index 80966c193..f0264b4c2 100644
--- a/app/panel/components/Settings/SettingsMenu.jsx
+++ b/app/panel/components/Settings/SettingsMenu.jsx
@@ -14,6 +14,10 @@
import React from 'react';
import { NavLink } from 'react-router-dom';
import ClassNames from 'classnames';
+import globals from '../../../../src/classes/Globals';
+
+const { IS_CLIQZ } = globals;
+
/**
* @const Implement left pane of the main Settings view as a
* menu which allows to navigate to Setting subviews.
@@ -41,6 +45,13 @@ const SettingsMenu = (props) => {
{ t('settings_general_settings') }
+ {!IS_CLIQZ && (
+
+
+ { t('settings_adblocker') }
+
+
+ )}
{ t('settings_notifications') }
diff --git a/package.json b/package.json
index 369adca6d..78326a781 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@cliqz/adblocker-circumvention": "^1.12.2",
"@cliqz/url-parser": "^1.1.3",
- "browser-core": "https://github.com/cliqz-oss/browser-core/releases/download/7.45.0/browser-core-7.45.0.tgz",
+ "browser-core": "https://github.com/cliqz-oss/browser-core/releases/download/v7.45.2/browser-core-7.45.2.tgz",
"classnames": "^2.2.5",
"d3": "^5.15.1",
"foundation-sites": "^6.6.2",
diff --git a/src/background.js b/src/background.js
index e6ef6225e..aaad084d4 100644
--- a/src/background.js
+++ b/src/background.js
@@ -1056,11 +1056,14 @@ function initializeDispatcher() {
setCliqzModuleEnabled(adblocker, false);
}
});
-
+ dispatcher.on('conf.save.cliqz_adb_mode', (val) => {
+ if (!IS_CLIQZ) {
+ cliqz.prefs.set('cliqz-adb-mode', val);
+ }
+ });
dispatcher.on('conf.changed.settings', debounce((key) => {
log('Conf value changed for a watched user setting:', key);
}, 200));
-
dispatcher.on('globals.save.paused_blocking', () => {
// if user has paused Ghostery, suspect broken page
if (globals.SESSION.paused_blocking) { metrics.handleBrokenPageTrigger(globals.BROKEN_PAGE_PAUSE); }
diff --git a/src/classes/ConfData.js b/src/classes/ConfData.js
index 09b38f48d..cd62556e2 100644
--- a/src/classes/ConfData.js
+++ b/src/classes/ConfData.js
@@ -100,6 +100,7 @@ class ConfData {
_initProperty('block_by_default', false);
_initProperty('bugs_last_checked', 0);
_initProperty('bugs_last_updated', nowTime);
+ _initProperty('cliqz_adb_mode', 0);
_initProperty('cliqz_legacy_opt_in', false);
_initProperty('cliqz_import_state', 0);
_initProperty('cmp_version', 0);
diff --git a/src/classes/Globals.js b/src/classes/Globals.js
index c1d3c27d4..cd56ccdb1 100644
--- a/src/classes/Globals.js
+++ b/src/classes/Globals.js
@@ -101,6 +101,7 @@ class Globals {
'alert_bubble_timeout',
'alert_expanded',
'block_by_default',
+ 'cliqz_adb_mode',
'cliqz_module_whitelist',
'current_theme',
'enable_ad_block',
diff --git a/src/classes/PanelData.js b/src/classes/PanelData.js
index 96b07c2a7..281433511 100644
--- a/src/classes/PanelData.js
+++ b/src/classes/PanelData.js
@@ -481,7 +481,7 @@ class PanelData {
*/
_getUserSettingsForSettingsView(userSettingsSource) {
const {
- alert_bubble_pos, alert_bubble_timeout, block_by_default, enable_autoupdate,
+ alert_bubble_pos, alert_bubble_timeout, block_by_default, cliqz_adb_mode, enable_autoupdate,
enable_click2play, enable_click2play_social, enable_human_web, enable_offers,
enable_metrics, hide_alert_trusted, ignore_first_party, notify_library_updates,
notify_promotions, notify_upgrade_updates, selected_app_ids, show_alert, show_badge,
@@ -492,6 +492,7 @@ class PanelData {
alert_bubble_pos,
alert_bubble_timeout,
block_by_default,
+ cliqz_adb_mode,
enable_autoupdate,
enable_click2play,
enable_click2play_social,
diff --git a/yarn.lock b/yarn.lock
index 83b80ea8b..3f0b42416 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1642,9 +1642,9 @@ brorand@^1.0.1:
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=
-"browser-core@https://github.com/cliqz-oss/browser-core/releases/download/7.45.0/browser-core-7.45.0.tgz":
- version "7.45.0"
- resolved "https://github.com/cliqz-oss/browser-core/releases/download/7.45.0/browser-core-7.45.0.tgz#bcd95e54f5992912f2e971ddabb607ba612c588d"
+"browser-core@https://github.com/cliqz-oss/browser-core/releases/download/v7.45.2/browser-core-7.45.2.tgz":
+ version "7.45.2"
+ resolved "https://github.com/cliqz-oss/browser-core/releases/download/v7.45.2/browser-core-7.45.2.tgz#548ff63f47ac7a92be2ffc2bb8edc6de84db7d73"
dependencies:
"@cliqz-oss/dexie" "^2.0.4"
"@cliqz/adblocker-webextension" "^1.9.2"