From 30520aa04fcb6051aabb99dc53d453eadb0774d9 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Fri, 19 Feb 2021 10:50:12 -0500 Subject: [PATCH 01/10] Default ad blocker to off on install in Dawn only --- src/background.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/background.js b/src/background.js index 4df14fa92..22010d742 100644 --- a/src/background.js +++ b/src/background.js @@ -1636,6 +1636,7 @@ function initializeGhosteryModules() { (async() => { await globals.BROWSER_INFO_READY; if (BROWSER_INFO.name === 'ghostery_desktop') { // i.e., Dawn + conf.enable_ad_block = false; // GH-2283 chrome.tabs.create({ url: chrome.runtime.getURL('./app/templates/dawn_hub.html?justInstalled=true'), active: true From bcc2cf787823628a03b8a95188bf218927673395 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Fri, 19 Feb 2021 11:07:39 -0500 Subject: [PATCH 02/10] Move disabling of ad block in Dawn to guard against race condition --- src/background.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/background.js b/src/background.js index 22010d742..246b22544 100644 --- a/src/background.js +++ b/src/background.js @@ -1548,6 +1548,9 @@ function initializeGhosteryModules() { // Make sure that getBrowserInfo() has resolved before we set these properties (async() => { await globals.BROWSER_INFO_READY; + if (globals.JUST_INSTALLED && BROWSER_INFO.name === 'ghostery_desktop') { // i.e., Dawn + conf.enable_ad_block = false; // GH-2283 + } if (IS_FIREFOX && BROWSER_INFO.name !== 'ghostery_desktop' && BROWSER_INFO.name !== 'ghostery_android') { if (globals.JUST_INSTALLED) { conf.enable_human_web = false; @@ -1636,7 +1639,6 @@ function initializeGhosteryModules() { (async() => { await globals.BROWSER_INFO_READY; if (BROWSER_INFO.name === 'ghostery_desktop') { // i.e., Dawn - conf.enable_ad_block = false; // GH-2283 chrome.tabs.create({ url: chrome.runtime.getURL('./app/templates/dawn_hub.html?justInstalled=true'), active: true From 7cfefe1e05282c590274d21d235b2a5bcc43e216 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Fri, 19 Feb 2021 16:57:47 -0500 Subject: [PATCH 03/10] Ensure that onboarding code does not switch ad block on by default --- .../Views/OnboardingView/OnboardingViewContainer.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx b/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx index 045de387e..05431b537 100644 --- a/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx +++ b/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx @@ -78,9 +78,9 @@ class OnboardingViewContainer extends Component { origin: ONBOARDING }); actions.setBlockingPolicy({ blockingPolicy: BLOCKING_POLICY_RECOMMENDED }); - actions.setAntiTracking({ enable_anti_tracking: true }); // covered - actions.setAdBlock({ enable_ad_block: true }); // covered - actions.setSmartBlocking({ enable_smart_block: true }); // covered + actions.setAntiTracking({ enable_anti_tracking: true }); + actions.setAdBlock({ enable_ad_block: false }); // GH-2283 + actions.setSmartBlocking({ enable_smart_block: true }); } } From a2ce1415932cc7e4298617a6019742f3ffd71139 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Tue, 23 Feb 2021 10:33:10 -0500 Subject: [PATCH 04/10] Change default enable_ad_block prop value to false in Dawn onboarding. --- app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx b/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx index 05431b537..7ba050bf3 100644 --- a/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx +++ b/app/dawn-hub/Views/OnboardingView/OnboardingViewContainer.jsx @@ -156,7 +156,7 @@ OnboardingViewContainer.defaultProps = { setup: { blockingPolicy: BLOCKING_POLICY_RECOMMENDED, enable_anti_tracking: true, - enable_ad_block: true, + enable_ad_block: false, enable_smart_block: true, }, }; From 0f7adfa1ee6f9c945a45aaa116c9f9bf44f2ae42 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Tue, 23 Feb 2021 10:41:57 -0500 Subject: [PATCH 05/10] Disable adblocker Cliqz module on startup --- src/classes/Cliqz.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/classes/Cliqz.js b/src/classes/Cliqz.js index 3a6f95d47..0a3640292 100644 --- a/src/classes/Cliqz.js +++ b/src/classes/Cliqz.js @@ -24,6 +24,7 @@ CLIQZ.config.default_prefs = { ...CLIQZ.config.default_prefs, // the following are enabled by default on non-android platforms 'modules.human-web.enabled': !IS_ANDROID, + 'modules.adblocker.enabled': false, 'modules.hpnv2.enabled': !IS_ANDROID, // the following are enabled for android only 'modules.human-web-lite.enabled': IS_ANDROID, From 634ce2a45d27453ced017f009e434e4c4b002122 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Tue, 23 Feb 2021 10:43:56 -0500 Subject: [PATCH 06/10] Reference ticket that motivates the Cliqz adblocker deactivation --- src/classes/Cliqz.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Cliqz.js b/src/classes/Cliqz.js index 0a3640292..f6bafbbb2 100644 --- a/src/classes/Cliqz.js +++ b/src/classes/Cliqz.js @@ -24,7 +24,7 @@ CLIQZ.config.default_prefs = { ...CLIQZ.config.default_prefs, // the following are enabled by default on non-android platforms 'modules.human-web.enabled': !IS_ANDROID, - 'modules.adblocker.enabled': false, + 'modules.adblocker.enabled': false, // GH-2283 'modules.hpnv2.enabled': !IS_ANDROID, // the following are enabled for android only 'modules.human-web-lite.enabled': IS_ANDROID, From 68ae62e1fbdf6e3925882af50c4646ac2ba98cc2 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Tue, 23 Feb 2021 10:48:39 -0500 Subject: [PATCH 07/10] Do not turn off ad blocker in background --- src/background.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/background.js b/src/background.js index 246b22544..4df14fa92 100644 --- a/src/background.js +++ b/src/background.js @@ -1548,9 +1548,6 @@ function initializeGhosteryModules() { // Make sure that getBrowserInfo() has resolved before we set these properties (async() => { await globals.BROWSER_INFO_READY; - if (globals.JUST_INSTALLED && BROWSER_INFO.name === 'ghostery_desktop') { // i.e., Dawn - conf.enable_ad_block = false; // GH-2283 - } if (IS_FIREFOX && BROWSER_INFO.name !== 'ghostery_desktop' && BROWSER_INFO.name !== 'ghostery_android') { if (globals.JUST_INSTALLED) { conf.enable_human_web = false; From 2feaf2888e3b132570d5edddd23ad047391f2fc8 Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Tue, 23 Feb 2021 11:06:42 -0500 Subject: [PATCH 08/10] Hardcode allowing Bing Ads bugs through --- src/classes/EventHandlers.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/classes/EventHandlers.js b/src/classes/EventHandlers.js index e873bc561..8cf7e7b7b 100644 --- a/src/classes/EventHandlers.js +++ b/src/classes/EventHandlers.js @@ -346,6 +346,11 @@ class EventHandlers { } const app_id = bugDb.db.bugs[bug_id].aid; + + if (app_id === 67) { // Bing Ads - GH-2283 + return { cancel: false }; + } + const cat_id = bugDb.db.apps[app_id].cat; const incognito = tabInfo.getTabInfo(tab_id, 'incognito'); const tab_host = tabInfo.getTabInfo(tab_id, 'host'); From c6cfdd6906feaed242c85a031775189770fe118a Mon Sep 17 00:00:00 2001 From: wlycdgr Date: Tue, 23 Feb 2021 11:28:08 -0500 Subject: [PATCH 09/10] Only deactivate Cliqz adblocker module on startup if extension has just been installed --- src/classes/Cliqz.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/classes/Cliqz.js b/src/classes/Cliqz.js index f6bafbbb2..532579f78 100644 --- a/src/classes/Cliqz.js +++ b/src/classes/Cliqz.js @@ -24,7 +24,6 @@ CLIQZ.config.default_prefs = { ...CLIQZ.config.default_prefs, // the following are enabled by default on non-android platforms 'modules.human-web.enabled': !IS_ANDROID, - 'modules.adblocker.enabled': false, // GH-2283 'modules.hpnv2.enabled': !IS_ANDROID, // the following are enabled for android only 'modules.human-web-lite.enabled': IS_ANDROID, @@ -35,4 +34,12 @@ if (IS_ANDROID) { CLIQZ.config.settings.HW_CHANNEL = 'android'; } +// GH-2283 +if (globals.JUST_INSTALLED) { + CLIQZ.config.default_prefs = { + ...CLIQZ.config.default_prefs, + 'modules.adblocker.enabled': false, + }; +} + export default new (CLIQZ.App)({ debug: globals.DEBUG }); From 31cf928cde97d0f5daa29c1da3de769669ff4109 Mon Sep 17 00:00:00 2001 From: Christopher Tino Date: Tue, 23 Feb 2021 15:43:25 -0500 Subject: [PATCH 10/10] update prefs to disable ad-blocker --- manifest.json | 2 +- src/background.js | 2 ++ src/classes/Cliqz.js | 9 +-------- src/classes/ConfData.js | 2 +- src/classes/EventHandlers.js | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/manifest.json b/manifest.json index edef02a03..4700eb994 100644 --- a/manifest.json +++ b/manifest.json @@ -94,4 +94,4 @@ "web_accessible_resources": [ "app/images/*" ] -} \ No newline at end of file +} diff --git a/src/background.js b/src/background.js index 4df14fa92..a801af5a8 100644 --- a/src/background.js +++ b/src/background.js @@ -1538,6 +1538,8 @@ function initializeGhosteryModules() { conf.enable_anti_tracking = !antitracking.isDisabled; conf.enable_human_web = !humanweb.isDisabled; + cliqz.prefs.set('modules.adblocker.enabled', conf.enable_ad_block); // GH-2283 + if (!antitracking.isDisabled) { antitracking.action('setConfigOption', 'networkFetchEnabled', !!conf.enable_autoupdate); } diff --git a/src/classes/Cliqz.js b/src/classes/Cliqz.js index 532579f78..084a14694 100644 --- a/src/classes/Cliqz.js +++ b/src/classes/Cliqz.js @@ -22,6 +22,7 @@ export const HPN_MODULE = IS_ANDROID ? 'hpn-lite' : 'hpnv2'; // Override the default prefs based on the platform CLIQZ.config.default_prefs = { ...CLIQZ.config.default_prefs, + 'modules.adblocker.enabled': false, // GH-2283 // the following are enabled by default on non-android platforms 'modules.human-web.enabled': !IS_ANDROID, 'modules.hpnv2.enabled': !IS_ANDROID, @@ -34,12 +35,4 @@ if (IS_ANDROID) { CLIQZ.config.settings.HW_CHANNEL = 'android'; } -// GH-2283 -if (globals.JUST_INSTALLED) { - CLIQZ.config.default_prefs = { - ...CLIQZ.config.default_prefs, - 'modules.adblocker.enabled': false, - }; -} - export default new (CLIQZ.App)({ debug: globals.DEBUG }); diff --git a/src/classes/ConfData.js b/src/classes/ConfData.js index c12bc6bd7..ab99d7c6b 100644 --- a/src/classes/ConfData.js +++ b/src/classes/ConfData.js @@ -97,6 +97,7 @@ class ConfData { (async() => { await globals.BROWSER_INFO_READY; _initProperty('enable_metrics', BROWSER_INFO.name === 'ghostery_desktop'); + _initProperty('enable_ad_block', !IS_CLIQZ && BROWSER_INFO.name !== 'ghostery_desktop'); // GH-2283 })(); // simple props @@ -111,7 +112,6 @@ class ConfData { _initProperty('cliqz_import_state', 0); _initProperty('cmp_version', 0); _initProperty('current_theme', 'default'); - _initProperty('enable_ad_block', !IS_CLIQZ); _initProperty('enable_anti_tracking', !IS_CLIQZ); _initProperty('enable_autoupdate', true); _initProperty('enable_click2play', true); diff --git a/src/classes/EventHandlers.js b/src/classes/EventHandlers.js index 8cf7e7b7b..720e24cf1 100644 --- a/src/classes/EventHandlers.js +++ b/src/classes/EventHandlers.js @@ -347,7 +347,7 @@ class EventHandlers { const app_id = bugDb.db.bugs[bug_id].aid; - if (app_id === 67) { // Bing Ads - GH-2283 + if (app_id === 67) { // GH-2283 return { cancel: false }; }