From 14c38c31049f28972ec113a5745d3163e6a383ae Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 1 Oct 2020 14:32:06 -0400 Subject: [PATCH 01/11] Rename anti tracking, ad blocking, smart blocking, ad block and ad block lists to their new names --- _locales/en/messages.json | 32 +++++++++---------- .../SetupAntiSuiteView.scss | 6 ++-- .../SetupAntiSuiteViewContainer.jsx | 4 +-- app/hub/Views/TutorialView/TutorialView.scss | 2 +- .../TutorialAntiSuiteView.jsx | 4 +-- .../BuildingBlocks/CliqzFeature.jsx | 8 ++--- app/scss/partials/_hub_svgs.scss | 4 +-- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ceb9eafaf..cb6473f41 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -675,10 +675,10 @@ "message": "Tracker is slow" }, "panel_tracker_warning_smartblock_tooltip": { - "message": "Tracker blocked by Smart Blocking" + "message": "Tracker blocked by Smart Browsing" }, "panel_tracker_warning_smartunblock_tooltip": { - "message": "Tracker unblocked by Smart Blocking" + "message": "Tracker unblocked by Smart Browsing" }, "panel_tracker_block_tooltip": { "message": "Block on all sites" @@ -807,10 +807,10 @@ "message": "This site is already whitelisted." }, "settings_adblocker": { - "message": "Ad Block Lists" + "message": "Ad-Block Lists" }, "settings_adblocker_lists": { - "message": "Load the following Ad Block filter lists:" + "message": "Load the following Ad-Block filter lists:" }, "settings_adblocker_list_1": { "message": "Ads only" @@ -1065,7 +1065,7 @@ "message": "Requests Modified:" }, "requests_modified_tooltip": { - "message": "Total number of tracking requests & elements modified by Anti-Tracking and Ad Blocking" + "message": "Total number of tracking requests & elements modified by Anti-Tracking and Ad-Blocking" }, "trackers_blocked": { "message": "Trackers Blocked:" @@ -1134,22 +1134,22 @@ "message": "Ghostery extension has been resumed." }, "alert_anti_track_on": { - "message": "Enhanced Anti-Tracking ON. Personal data will be anonymized." + "message": "Anti-Tracking ON. Personal data will be anonymized." }, "alert_anti_track_off": { - "message": "Enhanced Anti-Tracking OFF. Personal data will not be anonymized." + "message": "Anti-Tracking OFF. Personal data will not be anonymized." }, "alert_ad_block_on": { - "message": "Enhanced Ad-Blocking ON. Advertisements will be blocked." + "message": "Ad-Blocking ON. Advertisements will be blocked." }, "alert_ad_block_off": { - "message": "Enhanced Ad-Blocking OFF. Advertisements will not be blocked." + "message": "Ad-Blocking OFF. Advertisements will not be blocked." }, "alert_smart_block_on": { - "message": "Smart Blocking ON. Tracker blocking will be adjusted to optimize page performance." + "message": "Smart Browsing ON. Tracker blocking will be adjusted to optimize page performance." }, "alert_smart_block_off": { - "message": "Smart Blocking OFF. Tracker blocking will not be automatically adjusted." + "message": "Smart Browsing OFF. Tracker blocking will not be automatically adjusted." }, "alert_reload": { "message": "Reload to see changes." @@ -2150,8 +2150,8 @@ "ghostery_rewards": { "message": "ghostery rewards" }, - "enhanced_anti_tracking": { - "message": "Enhanced Anti-Tracking" + "anti_tracking": { + "message": "Anti-Tracking" }, "panel_rewards_view__reward": { "message": "Reward" @@ -2461,11 +2461,11 @@ "off": { "message": "Off" }, - "enhanced_ad_blocking": { - "message": "Enhanced Ad Blocking" + "ad_blocking": { + "message": "Ad-Blocking" }, "smart_blocking": { - "message": "Smart Blocking" + "message": "Smart Browsing" }, "smart_blocking_DESC": { "message": "Automatically block and unblock trackers to optimize page performance." diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss index eba6b5f6b..34a31dd8d 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss @@ -63,12 +63,12 @@ background-image: buildAdBlockActiveIcon(#1dafed); } -// Smart Blocking Icon +// Smart Browsing Icon .SetupAntiSuite__feature .smart-blocking { - background-image: buildSmartBlockingIcon(#9f9f9f); + background-image: buildSmartBrowsingIcon(#9f9f9f); } .SetupAntiSuite__feature .smart-blocking.active { - background-image: buildSmartBlockingActiveIcon(#1dafed); + background-image: buildSmartBrowsingActiveIcon(#1dafed); } // Ghostery Rewards Icon diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx index bc473de16..9a5f6be9e 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx @@ -107,7 +107,7 @@ class SetupAntiSuiteViewContainer extends Component { const features = [ { id: 'anti-tracking', - name: t('enhanced_anti_tracking'), + name: t('anti_tracking'), enabled: anti_tracking_enabled, locked: IS_CLIQZ, toggle: IS_CLIQZ ? @@ -117,7 +117,7 @@ class SetupAntiSuiteViewContainer extends Component { }, { id: 'ad-block', - name: t('enhanced_ad_blocking'), + name: t('ad_blocking'), enabled: ad_block_enabled, locked: IS_CLIQZ, toggle: IS_CLIQZ ? diff --git a/app/hub/Views/TutorialView/TutorialView.scss b/app/hub/Views/TutorialView/TutorialView.scss index eebb3226e..f01370908 100644 --- a/app/hub/Views/TutorialView/TutorialView.scss +++ b/app/hub/Views/TutorialView/TutorialView.scss @@ -250,7 +250,7 @@ background-position: left 11.5px top 4px; } .TutorialAntiSuiteView__key .TutorialView__keyImage.smart-block { - background-image: buildSmartBlockingIcon(#1dafed); + background-image: buildSmartBrowsingIcon(#1dafed); background-position: left 13.5px top 2px; } .TutorialAntiSuiteView__key .TutorialView__keyTitle { diff --git a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx index 886994943..1d0832d70 100644 --- a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx +++ b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx @@ -53,7 +53,7 @@ const TutorialAntiSuiteView = ({ isAndroid }) => (
- {t('enhanced_anti_tracking')} + {t('anti_tracking')}
{t('hub_tutorial_antisuite_antitracking_description')} @@ -64,7 +64,7 @@ const TutorialAntiSuiteView = ({ isAndroid }) => (
- {t('enhanced_ad_blocking')} + {t('ad_blocking')}
{t('ad_blocking_DESC')} diff --git a/app/panel/components/BuildingBlocks/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/CliqzFeature.jsx index 3abc03dc9..f870de19f 100644 --- a/app/panel/components/BuildingBlocks/CliqzFeature.jsx +++ b/app/panel/components/BuildingBlocks/CliqzFeature.jsx @@ -64,9 +64,9 @@ class CliqzFeature extends React.Component { switch (type) { case 'ad_block': - return t('enhanced_ad_blocking'); + return t('ad_blocking'); case 'anti_track': - return t('enhanced_anti_tracking'); + return t('anti_tracking'); case 'smart_block': return t('smart_blocking'); default: @@ -137,9 +137,9 @@ class CliqzFeature extends React.Component { const featureType = type === 'anti_track' ? 'anti_tracking' : type; let featureName; if (featureType === 'anti_tracking') { - featureName = t('enhanced_anti_tracking'); + featureName = t('anti_tracking'); } else if (featureType === 'ad_block') { - featureName = t('enhanced_ad_blocking'); + featureName = t('ad_blocking'); } else if (featureType === 'smart_block') { featureName = t('smart_blocking'); } diff --git a/app/scss/partials/_hub_svgs.scss b/app/scss/partials/_hub_svgs.scss index 63ad5deb3..2f7da5414 100644 --- a/app/scss/partials/_hub_svgs.scss +++ b/app/scss/partials/_hub_svgs.scss @@ -101,10 +101,10 @@ @function buildAdBlockActiveIcon($primary-color) { @return url('data:image/svg+xml;charset%3dUS-ASCII,%3Csvg%20width%3D%2223%22%20height%3D%2232%22%20xmlns%3D%22http://www.w3.org/2000/svg%22%3E%3Cg%20transform%3D%22translate(1.12%20.56)%22%20fill%3D%22#{_url-friendly-color($primary-color)}%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M4.525%2026.57c.713.714%201.423%201.429%202.14%202.137.052.052.153.08.233.08%202.443.003%204.885.004%207.327-.002a.42.42%200%200%200%20.265-.109c1.73-1.723%203.457-3.45%205.181-5.181a.418.418%200%200%200%20.114-.263c.007-2.45.006-4.9.004-7.35-.002-.067-.017-.154-.059-.199-.717-.728-1.439-1.45-2.152-2.167L4.525%2026.57m-.99-.982l13.05-13.051c-.7-.7-1.409-1.413-2.126-2.122a.36.36%200%200%200-.231-.081%201608.44%201608.44%200%200%200-7.327.001.414.414%200%200%200-.267.106%201715.804%201715.804%200%200%200-5.197%205.195.362.362%200%200%200-.102.225c-.005%202.465-.005%204.93-.001%207.393%200%20.067.025.15.07.194.712.722%201.43%201.439%202.13%202.14m17.582-6.014c0%201.317-.005%202.634.004%203.95a.92.92%200%200%201-.288.707%201994.487%201994.487%200%200%200-5.603%205.601.903.903%200%200%201-.685.288c-2.654-.006-5.31-.006-7.966%200a.909.909%200%200%201-.685-.286c-1.868-1.875-3.74-3.748-5.617-5.617A.872.872%200%200%201%200%2023.55C.006%2020.895.006%2018.24%200%2015.583c0-.277.084-.49.28-.686%201.877-1.87%203.75-3.741%205.62-5.618A.88.88%200%200%201%206.562%209c2.663.005%205.326.005%207.989%200%20.27%200%20.477.087.665.277%201.875%201.881%203.754%203.758%205.635%205.633.183.183.27.386.268.647-.007%201.339-.004%202.678-.004%204.017%22%20stroke%3D%22#{_url-friendly-color($primary-color)}%22/%3E%3Ccircle%20cx%3D%2210.92%22%20cy%3D%221.92%22%20r%3D%221.92%22/%3E%3C/g%3E%3C/svg%3E'); } -@function buildSmartBlockingIcon($primary-color) { // Also used in Tutorial Anti Suite View +@function buildSmartBrowsingIcon($primary-color) { // Also used in Tutorial Anti Suite View @return url('data:image/svg+xml;charset%3dUS-ASCII,%3Csvg%20width%3D%2218%22%20height%3D%2236%22%20xmlns%3D%22http://www.w3.org/2000/svg%22%3E%3Cg%20transform%3D%22translate(.04%20.32)%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M15.338%2017.571c-.093%201.622-.669%203.052-1.588%204.364-.413.591-.832%201.177-1.233%201.779-.573.858-1.032%201.77-1.208%202.801-.03.17-.136.157-.253.157l-2.424-.001c-.798%200-1.597-.005-2.396.003-.175.002-.237-.048-.272-.23-.19-.997-.632-1.889-1.192-2.724-.477-.709-.974-1.405-1.453-2.114a8.02%208.02%200%200%201-1.388-4.265c-.108-2.725%201.427-5.103%204.017-6.207%203.32-1.413%207.245.005%208.8%203.185.5%201.026.654%202.116.59%203.252zM6.098%2029.23h5.092v-.61H6.098v.61zm4.569%202.592H6.62c-.488%200-.577-.104-.514-.631h5.069c.07.519-.022.63-.508.63zm5.99-17.957c-1.392-3.063-3.808-4.764-7.091-5.157-2.796-.336-5.228.589-7.21%202.584C.143%2013.52-.388%2016.245.254%2019.258c.337%201.575%201.103%202.945%202.02%204.243.42.597.833%201.202%201.22%201.82.356.574.61%201.2.634%201.882.03.786.008%201.573.008%202.36h.03c0%20.653%200%201.306.002%201.959.006%201.164.914%202.147%202.065%202.223.15.01.202.054.239.207a2.232%202.232%200%200%200%202.16%201.732c1.042.001%201.928-.698%202.183-1.738.033-.136.07-.189.216-.2a2.245%202.245%200%200%200%202.088-2.258c0-1.216.01-2.432-.003-3.65-.011-.909.199-1.755.678-2.523.386-.619.798-1.225%201.222-1.817%201.212-1.698%202.07-3.531%202.23-5.649.105-1.376-.017-2.722-.59-3.984z%22%20fill%3D%22#{_url-friendly-color($primary-color)}%22/%3E%3Cpath%20d%3D%22M8.732%2015.614a.31.31%200%200%200-.184%200L4.596%2016.67a.356.356%200%200%200-.276.351c.018%202.834%201.526%205.464%204.118%207.223a.37.37%200%200%200%20.202.056.37.37%200%200%200%20.202-.056c2.592-1.76%204.1-4.389%204.118-7.223a.356.356%200%200%200-.276-.351l-3.952-1.056z%22%20stroke%3D%22#{_url-friendly-color($primary-color)}%22%20stroke-width%3D%221.44%22/%3E%3C/g%3E%3C/svg%3E'); } -@function buildSmartBlockingActiveIcon($primary-color) { +@function buildSmartBrowsingActiveIcon($primary-color) { @return url('data:image/svg+xml;charset%3dUS-ASCII,%3Csvg%20width%3D%2218%22%20height%3D%2236%22%20xmlns%3D%22http://www.w3.org/2000/svg%22%3E%3Cg%20transform%3D%22translate(.04%20.32)%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M15.338%2017.571c-.093%201.622-.669%203.052-1.588%204.364-.413.591-.832%201.177-1.233%201.779-.573.858-1.032%201.77-1.208%202.801-.03.17-.136.157-.253.157l-2.424-.001c-.798%200-1.597-.005-2.396.003-.175.002-.237-.048-.272-.23-.19-.997-.632-1.889-1.192-2.724-.477-.709-.974-1.405-1.453-2.114a8.02%208.02%200%200%201-1.388-4.265c-.108-2.725%201.427-5.103%204.017-6.207%203.32-1.413%207.245.005%208.8%203.185.5%201.026.654%202.116.59%203.252zM6.098%2029.23h5.092v-.61H6.098v.61zm4.569%202.592H6.62c-.488%200-.577-.104-.514-.631h5.069c.07.519-.022.63-.508.63zm5.99-17.957c-1.392-3.063-3.808-4.764-7.091-5.157-2.796-.336-5.228.589-7.21%202.584C.143%2013.52-.388%2016.245.254%2019.258c.337%201.575%201.103%202.945%202.02%204.243.42.597.833%201.202%201.22%201.82.356.574.61%201.2.634%201.882.03.786.008%201.573.008%202.36h.03c0%20.653%200%201.306.002%201.959.006%201.164.914%202.147%202.065%202.223.15.01.202.054.239.207a2.232%202.232%200%200%200%202.16%201.732c1.042.001%201.928-.698%202.183-1.738.033-.136.07-.189.216-.2a2.245%202.245%200%200%200%202.088-2.258c0-1.216.01-2.432-.003-3.65-.011-.909.199-1.755.678-2.523.386-.619.798-1.225%201.222-1.817%201.212-1.698%202.07-3.531%202.23-5.649.105-1.376-.017-2.722-.59-3.984z%22%20fill%3D%22#{_url-friendly-color($primary-color)}%22/%3E%3Cpath%20d%3D%22M8.732%2015.614a.31.31%200%200%200-.184%200L4.596%2016.67a.356.356%200%200%200-.276.351c.018%202.834%201.526%205.464%204.118%207.223a.37.37%200%200%200%20.202.056.37.37%200%200%200%20.202-.056c2.592-1.76%204.1-4.389%204.118-7.223a.356.356%200%200%200-.276-.351l-3.952-1.056z%22%20stroke%3D%22#{_url-friendly-color($primary-color)}%22%20stroke-width%3D%221.44%22/%3E%3Ccircle%20fill%3D%22#{_url-friendly-color($primary-color)}%22%20cx%3D%228.92%22%20cy%3D%221.92%22%20r%3D%221.92%22/%3E%3C/g%3E%3C/svg%3E'); } @function buildGhosteryRewardsIcon($primary-color) { From 71779724fd6e065d30011b3177aad4d65e384df1 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 1 Oct 2020 14:39:54 -0400 Subject: [PATCH 02/11] Update snapshot --- .../TutorialAntiSuiteView.test.jsx.snap | 4 ++-- .../__tests__/__snapshots__/OverviewTab.jsx.snap | 8 ++++---- .../__tests__/__snapshots__/CliqzFeature.jsx.snap | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap index bed91e7ce..8ab034caf 100644 --- a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap +++ b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap @@ -51,7 +51,7 @@ exports[`app/hub/Views/TutorialViews/TutorialAntiSuiteView component Snapshot te
- enhanced_anti_tracking + anti_tracking
- enhanced_ad_blocking + ad_blocking
- enhanced_anti_tracking + anti_tracking
@@ -202,7 +202,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit
- enhanced_ad_blocking + ad_blocking
@@ -455,7 +455,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit
- enhanced_anti_tracking + anti_tracking
@@ -477,7 +477,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit
- enhanced_ad_blocking + ad_blocking
diff --git a/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap b/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap index 16ba9dffd..3490f5c3b 100644 --- a/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap +++ b/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap @@ -17,7 +17,7 @@ exports[`app/panel/components/CliqzFeature.jsx Snapshot tests with react-test-re
- enhanced_anti_tracking + anti_tracking
- enhanced_ad_blocking + ad_blocking
- enhanced_anti_tracking + anti_tracking
- enhanced_ad_blocking + ad_blocking
- enhanced_anti_tracking + anti_tracking
- enhanced_ad_blocking + ad_blocking
Date: Thu, 1 Oct 2020 17:23:14 -0400 Subject: [PATCH 03/11] Update smart blocking to smart browsing in a few more places --- _locales/en/messages.json | 4 ++-- .../SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss | 4 ++-- .../SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx | 4 ++-- .../TutorialAntiSuiteView/TutorialAntiSuiteView.jsx | 4 ++-- app/panel/components/BuildingBlocks/CliqzFeature.jsx | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index cb6473f41..6cbf23c9a 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -2464,10 +2464,10 @@ "ad_blocking": { "message": "Ad-Blocking" }, - "smart_blocking": { + "smart_browsing": { "message": "Smart Browsing" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Automatically block and unblock trackers to optimize page performance." }, "ad_blocking_DESC": { diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss index 34a31dd8d..4f3570f49 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss @@ -64,10 +64,10 @@ } // Smart Browsing Icon -.SetupAntiSuite__feature .smart-blocking { +.SetupAntiSuite__feature .smart-browsing { background-image: buildSmartBrowsingIcon(#9f9f9f); } -.SetupAntiSuite__feature .smart-blocking.active { +.SetupAntiSuite__feature .smart-browsing.active { background-image: buildSmartBrowsingActiveIcon(#1dafed); } diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx index 9a5f6be9e..aa7fb2437 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx @@ -127,10 +127,10 @@ class SetupAntiSuiteViewContainer extends Component { }, { id: 'smart-blocking', - name: t('smart_blocking'), + name: t('smart_browsing'), enabled: enable_smart_block, toggle: () => this._handleToggle('smart-blocking'), - description: t('smart_blocking_DESC'), + description: t('smart_browsing_DESC'), } ]; diff --git a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx index 1d0832d70..bada816c4 100644 --- a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx +++ b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx @@ -75,10 +75,10 @@ const TutorialAntiSuiteView = ({ isAndroid }) => (
- {t('smart_blocking')} + {t('smart_browsing')}
- {t('smart_blocking_DESC')} + {t('smart_browsing_DESC')}
diff --git a/app/panel/components/BuildingBlocks/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/CliqzFeature.jsx index f870de19f..5b98c28fd 100644 --- a/app/panel/components/BuildingBlocks/CliqzFeature.jsx +++ b/app/panel/components/BuildingBlocks/CliqzFeature.jsx @@ -52,7 +52,7 @@ class CliqzFeature extends React.Component { case 'anti_track': return t('anti_tracking_DESC'); case 'smart_block': - return t('smart_blocking_DESC'); + return t('smart_browsing_DESC'); default: return false; } @@ -68,7 +68,7 @@ class CliqzFeature extends React.Component { case 'anti_track': return t('anti_tracking'); case 'smart_block': - return t('smart_blocking'); + return t('smart_browsing'); default: return false; } @@ -141,7 +141,7 @@ class CliqzFeature extends React.Component { } else if (featureType === 'ad_block') { featureName = t('ad_blocking'); } else if (featureType === 'smart_block') { - featureName = t('smart_blocking'); + featureName = t('smart_browsing'); } return ( From 9ce11ae941eb3182348e046254a1cf0b37492df7 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 1 Oct 2020 17:34:32 -0400 Subject: [PATCH 04/11] Update snapshot --- .../__snapshots__/TutorialAntiSuiteView.test.jsx.snap | 4 ++-- .../content/__tests__/__snapshots__/OverviewTab.jsx.snap | 4 ++-- .../__tests__/__snapshots__/CliqzFeature.jsx.snap | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap index 8ab034caf..9b217d4f3 100644 --- a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap +++ b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap @@ -89,12 +89,12 @@ exports[`app/hub/Views/TutorialViews/TutorialAntiSuiteView component Snapshot te
- smart_blocking + smart_browsing
- smart_blocking_DESC + smart_browsing_DESC
diff --git a/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap b/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap index 0502d6f15..b8330c0ba 100644 --- a/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap +++ b/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap @@ -224,7 +224,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit
- smart_blocking + smart_browsing
@@ -499,7 +499,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit
- smart_blocking + smart_browsing
diff --git a/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap b/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap index 3490f5c3b..86eb163db 100644 --- a/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap +++ b/app/panel/components/BuildingBlocks/__tests__/__snapshots__/CliqzFeature.jsx.snap @@ -53,7 +53,7 @@ exports[`app/panel/components/CliqzFeature.jsx Snapshot tests with react-test-re
- smart_blocking + smart_browsing
@@ -112,7 +112,7 @@ exports[`app/panel/components/CliqzFeature.jsx Snapshot tests with react-test-re
- smart_blocking + smart_browsing
@@ -171,7 +171,7 @@ exports[`app/panel/components/CliqzFeature.jsx Snapshot tests with react-test-re
- smart_blocking + smart_browsing
From 5da56d0810740ba6f39ba03b83a6bf8d3de90066 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 6 Oct 2020 17:40:08 -0400 Subject: [PATCH 05/11] Rename all variables from smartBlock -> smartBrowse, rename PolicySmartBlock.js to PolicySmartBrowse.js --- CHANGELOG.md | 2 +- CODEOWNERS | 2 +- _locales/de/messages.json | 12 ++-- _locales/en/messages.json | 8 +-- _locales/es/messages.json | 12 ++-- _locales/fr/messages.json | 12 ++-- _locales/hu/messages.json | 12 ++-- _locales/it/messages.json | 12 ++-- _locales/ja/messages.json | 12 ++-- _locales/ko/messages.json | 12 ++-- _locales/nl/messages.json | 12 ++-- _locales/pl/messages.json | 12 ++-- _locales/pt_BR/messages.json | 12 ++-- _locales/ru/messages.json | 12 ++-- _locales/zh_CN/messages.json | 12 ++-- _locales/zh_TW/messages.json | 12 ++-- app/hub/Views/SetupView/SetupViewConstants.js | 2 +- .../Views/SetupView/SetupViewContainer.jsx | 8 +-- app/hub/Views/SetupView/SetupViewReducer.js | 12 ++-- .../__tests__/SetupViewContainer.test.jsx | 2 +- .../__tests__/SetupViewReducer.test.js | 16 ++--- app/hub/Views/SetupView/index.js | 4 +- .../SetupAntiSuiteViewActions.js | 10 +-- .../SetupAntiSuiteViewContainer.jsx | 20 +++--- .../SetupAntiSuiteViewActions.test.js | 10 +-- app/hub/Views/TutorialView/TutorialView.scss | 2 +- .../TutorialAntiSuiteView.jsx | 2 +- .../TutorialAntiSuiteView.test.jsx.snap | 2 +- app/panel-android/actions/blockingActions.js | 4 +- app/panel-android/components/PanelAndroid.jsx | 4 +- .../components/content/BlockingTracker.jsx | 16 ++--- .../components/content/OverviewTab.jsx | 30 ++++----- .../content/__tests__/OverviewTab.jsx | 12 ++-- .../__snapshots__/OverviewTab.jsx.snap | 8 +-- app/panel/components/Blocking.jsx | 22 +++---- .../components/Blocking/BlockingHeader.jsx | 18 ++--- app/panel/components/Blocking/Categories.jsx | 8 +-- app/panel/components/Blocking/Category.jsx | 16 ++--- app/panel/components/Blocking/Tracker.jsx | 18 ++--- app/panel/components/Blocking/Trackers.jsx | 8 +-- .../BuildingBlocks/CliqzFeature.jsx | 12 ++-- .../BuildingBlocks/__tests__/CliqzFeature.jsx | 8 +-- .../__snapshots__/CliqzFeature.jsx.snap | 6 +- app/panel/components/Summary.jsx | 30 ++++----- app/panel/containers/BlockingContainer.js | 4 +- app/panel/reducers/panel.js | 6 +- app/panel/utils/blocking.js | 32 ++++----- app/scss/android/_blocking_tab.scss | 4 +- app/scss/android/_overview_tab.scss | 4 +- app/scss/partials/_blocking.scss | 2 +- app/scss/partials/_cliqz_feature.scss | 12 ++-- app/scss/partials/_svgs.scss | 4 +- src/background.js | 4 +- src/classes/ConfData.js | 2 +- src/classes/Debugger.js | 2 +- src/classes/EventHandlers.js | 22 +++---- src/classes/Globals.js | 2 +- src/classes/Metrics.js | 6 +- src/classes/PanelData.js | 40 +++++------ ...licySmartBlock.js => PolicySmartBrowse.js} | 34 +++++----- src/classes/TabInfo.js | 26 ++++---- test/src/PolicySmartBlock.test.js | 66 ------------------- test/src/PolicySmartBrowse.test.js | 66 +++++++++++++++++++ 63 files changed, 408 insertions(+), 408 deletions(-) rename src/classes/{PolicySmartBlock.js => PolicySmartBrowse.js} (88%) delete mode 100644 test/src/PolicySmartBlock.test.js create mode 100644 test/src/PolicySmartBrowse.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a547c8e..0f583aa66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,7 +126,7 @@ + Add new counter for Requests Modified by Anti-Tracking (#392) + Show fingerprint, cookie and advertisement icons in Detail View tracker list (#394) + Improved Anti-Tracking integration (#377) -+ Integrate Click2Play into SmartBlocking (#388) ++ Integrate Click2Play into SmartBrowsing (#388) + Respect pause state before displaying CMP and Rewards windows (Fixes #389) + Performance improvements (Fixes #12) + Improved Ad-Blocker filter rule injection (Fixes #381) diff --git a/CODEOWNERS b/CODEOWNERS index 0ec6fd468..15b146e0f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -10,7 +10,7 @@ /src/classes/CMP.js @christophertino /src/classes/EventHandlers.js @christophertino /src/classes/Metrics.js @wlycdgr -/src/classes/PolicySmartBlock.js @christophertino +/src/classes/PolicySmartBrowse.js @christophertino /src/classes/Conf.js @christophertino /src/classes/ConfData.js @christophertino /src/classes/PanelData.js @wlycdgr diff --git a/_locales/de/messages.json b/_locales/de/messages.json index a5361c941..b854e4d5a 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Der Tracker ist langsam" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Tracker von Smart Blocking blockiert" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Erweiterter Werbeblocker AUS. Werbung wird nicht gesperrt." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Smart Blocking AN. Tracker-Blockierung wird angepasst, um die Seitenleistung zu optimieren." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Smart Blocking AUS. Tracker-Blockierung wird nicht automatisch angepasst." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Werbung wurde gesperrt." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Tracker-Blockierung wurde angepasst, um die Seitenleistung zu optimieren." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Besserer Werbeblocker" }, - "smart_blocking": { + "smart_browsing": { "message": "Smart Blocking" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Tracker automatisch blockieren und entsperren, um die Seitenperformance zu optimieren." }, "ad_blocking_DESC": { diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 6cbf23c9a..0aadf18b9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Tracker is slow" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Tracker blocked by Smart Browsing" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Ad-Blocking OFF. Advertisements will not be blocked." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Smart Browsing ON. Tracker blocking will be adjusted to optimize page performance." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Smart Browsing OFF. Tracker blocking will not be automatically adjusted." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Advertisements have been blocked." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Tracker blocking adjusted to optimize page performance." }, "tooltip_trust": { diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 4fe8dc2d6..f6613e0db 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "El rastreador es lento" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Rastreador bloqueado por el bloqueador inteligente" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Bloqueo de anuncios mejorado NO No se bloquearán los anuncios." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Bloqueo inteligente SÍ. Se ajustará automáticamente el bloqueador de rastreadores para optimizar el rendimiento de la página." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Bloqueo inteligente NO. No se ajustará automáticamente el bloqueo de rastreadores." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Se ha bloqueado el anuncio." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Se ajustará el bloqueador de rastreadores para optimizar el rendimiento de la página." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Bloqueador de anuncios avanzado" }, - "smart_blocking": { + "smart_browsing": { "message": "Bloqueo inteligente" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Bloquea y desbloquea automáticamente los rastreadores para optimizar el rendimiento de la página." }, "ad_blocking_DESC": { diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 07706b3f6..32cba8007 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Le mouchard est lent" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Outil de pistage bloqué par Smart Blocking" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Blocage amélioré des publicités DÉSACTIVÉ Les publicités ne seront pas bloquées." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Blocage intelligent ACTIVÉ. Le blocage des mouchards sera ajusté pour améliorer les performances de la page." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Blocage intelligent DÉSACTIVÉ. Le blocage des mouchards ne sera pas ajusté automatiquement." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Les publicités ont été bloquées." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Blocage des mouchards ajusté pour améliorer les performances de la page." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Blocage amélioré des publicités" }, - "smart_blocking": { + "smart_browsing": { "message": "Blocage intelligent" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Bloquer et débloquer automatiquement les mouchards pour optimiser les performances des pages." }, "ad_blocking_DESC": { diff --git a/_locales/hu/messages.json b/_locales/hu/messages.json index 51b7534ad..83669ee0c 100644 --- a/_locales/hu/messages.json +++ b/_locales/hu/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "A tracker lassú" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Tracker blokkolva az Okos Blokkolás (Smart Blocking) által" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Fejlesztett hirdetésblokkolás KI van kapcsolva A hirdetések nem lesznek kiszűrve." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Okos blokkolás BE van kapcsolva. A tracker-szűrés az oldal teljesítményének optimalizálására lesz beállítva." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Okos blokkolás KI van kapcsolva. A tracker-szűrés nem lesz automatikusan beállítva." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "A hirdetések ki lesznek kiszűrve." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "A tracker-szűrés az oldal teljesítményének optimalizálására van beállítva." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Fejlesztett hirdetésblokkolás" }, - "smart_blocking": { + "smart_browsing": { "message": "Okos blokkolás" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Automatikusan blokkolja vagy feloldja a trackereket az oldal teljesítményének optimalizálásához." }, "ad_blocking_DESC": { diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 28ac61039..00bcc66c1 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Il tracker è lento" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Tracker bloccato da Blocco Intelligente" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Blocco delle Pubblicità Avanzato DISATTIVATO. Le pubblicità non verranno bloccate." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Blocco Intelligente ATTIVO. Il blocco dei tracker verrà regolato per ottimizzare le prestazioni della pagina." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Blocco Intelligente DISATTIVATO. Il blocco dei tracker non verrà regolato automaticamente." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Le pubblicità sono state bloccate." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Il blocco dei tracker è stato regolato per ottimizzare le prestazioni della pagina." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Blocco delle Pubblicità Avanzato" }, - "smart_blocking": { + "smart_browsing": { "message": "Blocco Intelligente" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Blocca e sblocca automaticamente i tracker per ottimizzare la prestazione della pagina." }, "ad_blocking_DESC": { diff --git a/_locales/ja/messages.json b/_locales/ja/messages.json index 93e118f67..8046255af 100644 --- a/_locales/ja/messages.json +++ b/_locales/ja/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "トラッカーが遅いです" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "トラッカーがスマート・ブロッキングによってブロックされました" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "強化された広告ブロッキングがオフになりました。広告はブロックされません。" }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "スマート・ブロッキングがオンになりました。ページのパフォーマンスを最適化するために、トラッカー・ブロッキングを調整します。" }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "スマート・ブロッキングがオフになりました。トラッカー・ブロッキングは自動的に調整されません。" }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "広告がブロックされました。" }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "ページのパフォーマンスを最適化するために、トラッカー・ブロッキングを調整しました。" }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "強化された広告ブロッキング" }, - "smart_blocking": { + "smart_browsing": { "message": "スマート・ブロッキング" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "トラッカーを自動的にブロックおよびブロック解除して、ページのパフォーマンスを最適化します。" }, "ad_blocking_DESC": { diff --git a/_locales/ko/messages.json b/_locales/ko/messages.json index 2682b8e3d..8e8b01f41 100644 --- a/_locales/ko/messages.json +++ b/_locales/ko/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "느린 " }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "스마트 차단 기능으로 트래커 차단됨" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "강화된 광고 차단 꺼짐 광고가 차단되지 않습니다." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "스마트 차단 켜짐. 트래커 차단 기능이 페이지 성능을 최적화할 수 있도록 조정됩니다." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "스마트 차단 꺼짐. 트래커 차단 기능이 자동으로 조정되지 않습니다." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "광고가 차단되었습니다." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "트래커 차단 기능이 페이지 성능을 최적화할 수 있도록 조정되었습니다." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "강화된 광고 차단 " }, - "smart_blocking": { + "smart_browsing": { "message": "스마트 차단 " }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "트래커를 자동으로 차단 및 차단 해제하여 페이지 성능을 최적화합니다." }, "ad_blocking_DESC": { diff --git a/_locales/nl/messages.json b/_locales/nl/messages.json index 0ace297c7..d2db915f7 100644 --- a/_locales/nl/messages.json +++ b/_locales/nl/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Tracker is langzaam" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Tracker geblokkeerd door Smart Blocking" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Versterkte Ad Blokkering UIT. Advertenties zullen niet worden geblokkeerd." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Slim Blokkeren AAN. Tracker blokkering wordt aangepast om prestaties van de pagina te optimaliseren." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Slim Blokkeren UIT. Tracker blokkering zal niet automatisch worden aangepast." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Advertenties zijn geblokkeerd." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Tracker blokkering aangepast om prestaties van de pagina te optimaliseren." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Versterkte Ad Blokkering" }, - "smart_blocking": { + "smart_browsing": { "message": "Slim Blokkeren" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Blokkeer en deblokkeer trackers automatisch om pagina-performance te optimaliseren." }, "ad_blocking_DESC": { diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index d603cb745..641723307 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Tropiciel spowalnia działanie" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Tropiciel zablokowany przez Blokowanie inteligentne" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Wzmocnione blokowanie reklam WYŁĄCZONE. Reklamy nie będą blokowane." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Blokowanie inteligentne WŁĄCZONE. Blokowanie tropicieli będzie dostosowywane w celu zoptymalizowania wydajności strony." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Blokowanie inteligentne WYŁĄCZONE. Blokowanie tropicieli nie będzie dostosowywane automatycznie." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Zablokowano reklamy." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Blokowanie tropicieli dostosowane w celu zoptymalizowania wydajności strony." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Wzmocnione blokowanie reklam" }, - "smart_blocking": { + "smart_browsing": { "message": "Blokowanie inteligentne" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Automatycznie blokuj i odblokowuj tropiciele w celu zoptymalizowania wydajności strony." }, "ad_blocking_DESC": { diff --git a/_locales/pt_BR/messages.json b/_locales/pt_BR/messages.json index a0d5e5378..64be4c914 100644 --- a/_locales/pt_BR/messages.json +++ b/_locales/pt_BR/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "O rastreador é lento" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Rastreador bloqueado pelo Bloqueio Inteligente" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "O bloqueio de anúncios aprimorado está DESATIVADO Os anúncios não serão bloqueados." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Bloqueio inteligente ATIVADO. O bloqueio inteligente será ajustado para otimizar o desempenho da página." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Bloqueio inteligente DESATIVADO. O bloqueador de rastreadores não será automaticamente ajustado." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Os anúncios não foram bloqueados." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "O bloqueio inteligente ajustado para otimizar o desempenho da página." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Bloqueio de anúncios aprimorado" }, - "smart_blocking": { + "smart_browsing": { "message": "Bloqueio inteligente" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Bloquear e desbloquear automaticamente os rastreadores para otimizar o desempenho da página" }, "ad_blocking_DESC": { diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index f806d94b7..bc14b1a26 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "Трекер медленный" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "Трекер заблокирован Smart Blocking" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "Усовершенствованная блокировка рекламы отключена. Реклама не будет заблокирована." }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "Умная блокировка включена. Блокировка трекеров будет откорректирована для оптимизации работы страницы." }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "Умная блокировка отключена. Блокировка трекеров не будет автоматически корректироваться." }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "Реклама заблокирована." }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "Блокировка трекеров откорректирована для оптимизации работы страницы." }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "Рекламоблокер++" }, - "smart_blocking": { + "smart_browsing": { "message": "Умная блокировка" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "Автоматически блокирует и разблокирует трекеры для оптимизации работы страницы." }, "ad_blocking_DESC": { diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index c9e4b037c..51a163961 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "跟踪器降低网页加载速度" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "智能拦截功能拦截的跟踪器" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "增强版广告拦截功能已关闭。广告不会被拦截。" }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "智能拦截功能已开启。将调整跟踪器拦截功能以优化页面性能。" }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "智能拦截功能已关闭。跟踪器拦截功能将不会自动调整。" }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "广告已被拦截。" }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "已调整跟踪器拦截功能以优化页面性能。" }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "增强型广告屏蔽" }, - "smart_blocking": { + "smart_browsing": { "message": "智能拦截" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "自动拦截和取消拦截跟踪器,优化网页性能。" }, "ad_blocking_DESC": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 4a5c84891..a3a3fdb93 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -674,7 +674,7 @@ "panel_tracker_warning_slow_tooltip": { "message": "網頁跟縱器工作緩慢" }, - "panel_tracker_warning_smartblock_tooltip": { + "panel_tracker_warning_smartbrowse_tooltip": { "message": "追蹤器已被智能攔截功能攔截" }, "panel_tracker_warning_smartunblock_tooltip": { @@ -1145,10 +1145,10 @@ "alert_ad_block_off": { "message": "強化了的廣告封鎖功能已停用廣告將不會被封鎖。" }, - "alert_smart_block_on": { + "alert_smart_browse_on": { "message": "智能封鎖已啟動。\n跟蹤器封鎖功能將被調整以優化網頁效能。" }, - "alert_smart_block_off": { + "alert_smart_browse_off": { "message": "智能封鎖已關閉。跟蹤器封鎖功能不會自動調整。" }, "alert_reload": { @@ -1175,7 +1175,7 @@ "tooltip_ad_block_on": { "message": "廣告已被封鎖。" }, - "tooltip_smart_block_on": { + "tooltip_smart_browse_on": { "message": "跟蹤器封鎖功能被調整以優化網頁效能。" }, "tooltip_trust": { @@ -2464,10 +2464,10 @@ "enhanced_ad_blocking": { "message": "強反了的廣告封鎖" }, - "smart_blocking": { + "smart_browsing": { "message": "智能阻止" }, - "smart_blocking_DESC": { + "smart_browsing_DESC": { "message": "自動封鎖及解封網頁跟蹤器以優化網頁的效率。" }, "ad_blocking_DESC": { diff --git a/app/hub/Views/SetupView/SetupViewConstants.js b/app/hub/Views/SetupView/SetupViewConstants.js index 73744d686..e86b5308e 100644 --- a/app/hub/Views/SetupView/SetupViewConstants.js +++ b/app/hub/Views/SetupView/SetupViewConstants.js @@ -28,7 +28,7 @@ export const BLOCKING_POLICY_CUSTOM = 'BLOCKING_POLICY_CUSTOM'; // Setup Anti-Suite export const SET_ANTI_TRACKING = 'SET_ANTI_TRACKING'; export const SET_AD_BLOCK = 'SET_AD_BLOCK'; -export const SET_SMART_BLOCK = 'SET_SMART_BLOCK'; +export const SET_SMART_BROWSE = 'SET_SMART_BROWSE'; export const SET_GHOSTERY_REWARDS = 'SET_GHOSTERY_REWARDS'; // Setup Human Web diff --git a/app/hub/Views/SetupView/SetupViewContainer.jsx b/app/hub/Views/SetupView/SetupViewContainer.jsx index 38e410a23..71ffa0d40 100644 --- a/app/hub/Views/SetupView/SetupViewContainer.jsx +++ b/app/hub/Views/SetupView/SetupViewContainer.jsx @@ -109,7 +109,7 @@ class SetupViewContainer extends Component { actions.setBlockingPolicy({ blockingPolicy: BLOCKING_POLICY_RECOMMENDED }); actions.setAntiTracking({ enable_anti_tracking: true }); actions.setAdBlock({ enable_ad_block: true }); - actions.setSmartBlocking({ enable_smart_block: true }); + actions.setSmartBrowsing({ enable_smart_browse: true }); actions.setGhosteryRewards({ enable_ghostery_rewards: !IS_FIREFOX && !IS_ANDROID }); actions.setHumanWeb({ enable_human_web: !IS_FIREFOX || BROWSER_INFO.name === 'ghostery_android' }); } @@ -248,7 +248,7 @@ SetupViewContainer.propTypes = { blockingPolicy: PropTypes.string, enable_anti_tracking: PropTypes.bool, enable_ad_block: PropTypes.bool, - enable_smart_block: PropTypes.bool, + enable_smart_browse: PropTypes.bool, enable_ghostery_rewards: PropTypes.bool, enable_human_web: PropTypes.bool, }), @@ -261,7 +261,7 @@ SetupViewContainer.propTypes = { setBlockingPolicy: PropTypes.func.isRequired, setAntiTracking: PropTypes.func.isRequired, setAdBlock: PropTypes.func.isRequired, - setSmartBlocking: PropTypes.func.isRequired, + setSmartBrowsing: PropTypes.func.isRequired, setGhosteryRewards: PropTypes.func.isRequired, setHumanWeb: PropTypes.func.isRequired, setSetupComplete: PropTypes.func.isRequired, @@ -285,7 +285,7 @@ SetupViewContainer.defaultProps = { blockingPolicy: BLOCKING_POLICY_RECOMMENDED, enable_anti_tracking: true, enable_ad_block: true, - enable_smart_block: true, + enable_smart_browse: true, enable_ghostery_rewards: true, enable_human_web: true, }, diff --git a/app/hub/Views/SetupView/SetupViewReducer.js b/app/hub/Views/SetupView/SetupViewReducer.js index 46c5c51a1..882fe8fd2 100644 --- a/app/hub/Views/SetupView/SetupViewReducer.js +++ b/app/hub/Views/SetupView/SetupViewReducer.js @@ -19,7 +19,7 @@ import { SET_BLOCKING_POLICY, SET_ANTI_TRACKING, SET_AD_BLOCK, - SET_SMART_BLOCK, + SET_SMART_BROWSE, SET_GHOSTERY_REWARDS, SET_HUMAN_WEB } from './SetupViewConstants'; @@ -41,7 +41,7 @@ function SetupViewReducer(state = initialState, action) { blockingPolicy, enable_anti_tracking, enable_ad_block, - enable_smart_block, + enable_smart_browse, enable_ghostery_rewards, enable_human_web, } = action.data; @@ -70,7 +70,7 @@ function SetupViewReducer(state = initialState, action) { blockingPolicy, enable_anti_tracking, enable_ad_block, - enable_smart_block, + enable_smart_browse, enable_ghostery_rewards, enable_human_web, } @@ -118,9 +118,9 @@ function SetupViewReducer(state = initialState, action) { const { enable_ad_block } = action.data; return { ...state, setup: { ...state.setup, enable_ad_block } }; } - case SET_SMART_BLOCK: { - const { enable_smart_block } = action.data; - return { ...state, setup: { ...state.setup, enable_smart_block } }; + case SET_SMART_BROWSE: { + const { enable_smart_browse } = action.data; + return { ...state, setup: { ...state.setup, enable_smart_browse } }; } case SET_GHOSTERY_REWARDS: { const { enable_ghostery_rewards } = action.data; diff --git a/app/hub/Views/SetupView/__tests__/SetupViewContainer.test.jsx b/app/hub/Views/SetupView/__tests__/SetupViewContainer.test.jsx index 163b4ec80..b5865223e 100644 --- a/app/hub/Views/SetupView/__tests__/SetupViewContainer.test.jsx +++ b/app/hub/Views/SetupView/__tests__/SetupViewContainer.test.jsx @@ -44,7 +44,7 @@ const actions = { setBlockingPolicy: () => {}, setAntiTracking: () => {}, setAdBlock: () => {}, - setSmartBlocking: () => {}, + setSmartBrowsing: () => {}, setGhosteryRewards: () => {}, setHumanWeb: () => {}, setSetupComplete: () => {}, diff --git a/app/hub/Views/SetupView/__tests__/SetupViewReducer.test.js b/app/hub/Views/SetupView/__tests__/SetupViewReducer.test.js index 865ec3a7b..9fbfd962e 100644 --- a/app/hub/Views/SetupView/__tests__/SetupViewReducer.test.js +++ b/app/hub/Views/SetupView/__tests__/SetupViewReducer.test.js @@ -23,7 +23,7 @@ import { BLOCKING_POLICY_NOTHING, SET_ANTI_TRACKING, SET_AD_BLOCK, - SET_SMART_BLOCK, + SET_SMART_BROWSE, SET_GHOSTERY_REWARDS, SET_HUMAN_WEB } from '../SetupViewConstants'; @@ -44,7 +44,7 @@ const initialState = Immutable({ blockingPolicy: BLOCKING_POLICY_RECOMMENDED, enable_anti_tracking: true, enable_ad_block: true, - enable_smart_block: true, + enable_smart_browse: true, enable_ghostery_rewards: true, enable_human_web: true, }, @@ -149,17 +149,17 @@ describe('app/hub/Views/SetupView reducer', () => { }); }); - test('reducer correctly handles SET_SMART_BLOCK', () => { + test('reducer correctly handles SET_SMART_BROWSE', () => { const data = { test: 'test-bad-data', - enable_smart_block: false, + enable_smart_browse: false, }; - const action = { data, type: SET_SMART_BLOCK }; + const action = { data, type: SET_SMART_BROWSE }; const initState = Immutable({ setup: { test: 'test-good-data', example: 'example-good-data', - enable_smart_block: 'ESB-bad-data', + enable_smart_browse: 'ESB-bad-data', } }); @@ -167,7 +167,7 @@ describe('app/hub/Views/SetupView reducer', () => { setup: { test: 'test-good-data', example: 'example-good-data', - enable_smart_block: data.enable_smart_block, + enable_smart_browse: data.enable_smart_browse, } }); }); @@ -176,7 +176,7 @@ describe('app/hub/Views/SetupView reducer', () => { const data = { test: 'test-bad-data', enable_ad_block: true, // Bad Data - enable_smart_block: false, // Bad Data + enable_smart_browse: false, // Bad Data enable_ghostery_rewards: false, }; const action = { data, type: SET_GHOSTERY_REWARDS }; diff --git a/app/hub/Views/SetupView/index.js b/app/hub/Views/SetupView/index.js index 5bd10681d..59c556e8c 100644 --- a/app/hub/Views/SetupView/index.js +++ b/app/hub/Views/SetupView/index.js @@ -22,7 +22,7 @@ import setBlockingPolicy from '../SetupViews/SetupBlockingView/SetupBlockingView import { setAntiTracking, setAdBlock, - setSmartBlocking, + setSmartBrowsing, setGhosteryRewards } from '../SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewActions'; import setHumanWeb from '../SetupViews/SetupHumanWebView/SetupHumanWebViewActions'; @@ -48,7 +48,7 @@ const mapDispatchToProps = dispatch => ({ setBlockingPolicy, setAntiTracking, setAdBlock, - setSmartBlocking, + setSmartBrowsing, setGhosteryRewards, setHumanWeb, setSetupComplete diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewActions.js b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewActions.js index f26319b72..53b880d5c 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewActions.js +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewActions.js @@ -15,7 +15,7 @@ import { log, sendMessageInPromise } from '../../../utils'; import { SET_ANTI_TRACKING, SET_AD_BLOCK, - SET_SMART_BLOCK, + SET_SMART_BROWSE, SET_GHOSTERY_REWARDS } from '../../SetupView/SetupViewConstants'; @@ -45,15 +45,15 @@ export function setAdBlock(actionData) { }; } -export function setSmartBlocking(actionData) { +export function setSmartBrowsing(actionData) { return function(dispatch) { - return sendMessageInPromise(SET_SMART_BLOCK, actionData).then((data) => { + return sendMessageInPromise(SET_SMART_BROWSE, actionData).then((data) => { dispatch({ - type: SET_SMART_BLOCK, + type: SET_SMART_BROWSE, data, }); }).catch((err) => { - log('setupBlocking Action setSmartBlocking Error', err); + log('setupBlocking Action setSmartBrowsing Error', err); }); }; } diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx index aa7fb2437..fb9c8605d 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteViewContainer.jsx @@ -47,13 +47,13 @@ class SetupAntiSuiteViewContainer extends Component { const { enable_anti_tracking, enable_ad_block, - enable_smart_block, + enable_smart_browse, enable_ghostery_rewards } = setup; props.actions.setSetupStep({ setup_step: 9 }); props.actions.setAntiTracking({ enable_anti_tracking }); props.actions.setAdBlock({ enable_ad_block }); - props.actions.setSmartBlocking({ enable_smart_block }); + props.actions.setSmartBrowsing({ enable_smart_browse }); props.actions.setGhosteryRewards({ enable_ghostery_rewards }); } } @@ -75,9 +75,9 @@ class SetupAntiSuiteViewContainer extends Component { actions.setAdBlock({ enable_ad_block }); break; } - case 'smart-blocking': { - const enable_smart_block = !setup.enable_smart_block; - actions.setSmartBlocking({ enable_smart_block }); + case 'smart-browsing': { + const enable_smart_browse = !setup.enable_smart_browse; + actions.setSmartBrowsing({ enable_smart_browse }); break; } case 'ghostery-rewards': { @@ -98,7 +98,7 @@ class SetupAntiSuiteViewContainer extends Component { const { enable_anti_tracking, enable_ad_block, - enable_smart_block, + enable_smart_browse, enable_ghostery_rewards, } = setup; @@ -126,10 +126,10 @@ class SetupAntiSuiteViewContainer extends Component { description: IS_CLIQZ ? t('hub_setup_feature_already_active') : t('ad_blocking_DESC'), }, { - id: 'smart-blocking', + id: 'smart-browsing', name: t('smart_browsing'), - enabled: enable_smart_block, - toggle: () => this._handleToggle('smart-blocking'), + enabled: enable_smart_browse, + toggle: () => this._handleToggle('smart-browsing'), description: t('smart_browsing_DESC'), } ]; @@ -156,7 +156,7 @@ SetupAntiSuiteViewContainer.propTypes = { setSetupNavigation: PropTypes.func.isRequired, setAntiTracking: PropTypes.func.isRequired, setAdBlock: PropTypes.func.isRequired, - setSmartBlocking: PropTypes.func.isRequired, + setSmartBrowsing: PropTypes.func.isRequired, setGhosteryRewards: PropTypes.func.isRequired }).isRequired, sendMountActions: PropTypes.bool.isRequired, diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/__tests__/SetupAntiSuiteViewActions.test.js b/app/hub/Views/SetupViews/SetupAntiSuiteView/__tests__/SetupAntiSuiteViewActions.test.js index 2fe71a39d..2de088c03 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/__tests__/SetupAntiSuiteViewActions.test.js +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/__tests__/SetupAntiSuiteViewActions.test.js @@ -18,7 +18,7 @@ import * as SetupAntiSuiteViewActions from '../SetupAntiSuiteViewActions'; import { SET_ANTI_TRACKING, SET_AD_BLOCK, - SET_SMART_BLOCK, + SET_SMART_BROWSE, SET_GHOSTERY_REWARDS } from '../../../SetupView/SetupViewConstants'; @@ -36,7 +36,7 @@ utils.sendMessageInPromise = jest.fn((name, message) => new Promise((resolve, re resolve(message); break; } - case SET_SMART_BLOCK: { + case SET_SMART_BROWSE: { resolve(message); break; } @@ -75,14 +75,14 @@ describe('app/hub/Views/SetupViews/SetupAntiSuiteView actions', () => { }); }); - test('setSmartBlocking action should return correctly', () => { + test('setSmartBrowsing action should return correctly', () => { const initialState = {}; const store = mockStore(initialState); const data = testData; - const expectedPayload = { data, type: SET_SMART_BLOCK }; + const expectedPayload = { data, type: SET_SMART_BROWSE }; - return store.dispatch(SetupAntiSuiteViewActions.setSmartBlocking(data)).then(() => { + return store.dispatch(SetupAntiSuiteViewActions.setSmartBrowsing(data)).then(() => { const actions = store.getActions(); expect(actions).toEqual([expectedPayload]); }); diff --git a/app/hub/Views/TutorialView/TutorialView.scss b/app/hub/Views/TutorialView/TutorialView.scss index f01370908..428f3b21d 100644 --- a/app/hub/Views/TutorialView/TutorialView.scss +++ b/app/hub/Views/TutorialView/TutorialView.scss @@ -249,7 +249,7 @@ background-image: buildAdBlockIcon(#1dafed); background-position: left 11.5px top 4px; } -.TutorialAntiSuiteView__key .TutorialView__keyImage.smart-block { +.TutorialAntiSuiteView__key .TutorialView__keyImage.smart-browse { background-image: buildSmartBrowsingIcon(#1dafed); background-position: left 13.5px top 2px; } diff --git a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx index bada816c4..b7657bc3c 100644 --- a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx +++ b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/TutorialAntiSuiteView.jsx @@ -72,7 +72,7 @@ const TutorialAntiSuiteView = ({ isAndroid }) => (
-
+
{t('smart_browsing')} diff --git a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap index 9b217d4f3..e9acc6d0a 100644 --- a/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap +++ b/app/hub/Views/TutorialViews/TutorialAntiSuiteView/__test__/__snapshots__/TutorialAntiSuiteView.test.jsx.snap @@ -83,7 +83,7 @@ exports[`app/hub/Views/TutorialViews/TutorialAntiSuiteView component Snapshot te className="TutorialView__keyItem flex-container align-middle" >
@@ -392,8 +392,8 @@ OverviewTab.propTypes = { panel: PropTypes.shape({ enable_ad_block: PropTypes.bool.isRequired, enable_anti_tracking: PropTypes.bool.isRequired, - enable_smart_block: PropTypes.bool.isRequired, - smartBlock: PropTypes.shape({ + enable_smart_browse: PropTypes.bool.isRequired, + smartBrowse: PropTypes.shape({ blocked: PropTypes.shape({}).isRequired, unblocked: PropTypes.shape({}).isRequired, }).isRequired, diff --git a/app/panel-android/components/content/__tests__/OverviewTab.jsx b/app/panel-android/components/content/__tests__/OverviewTab.jsx index 4fec3f938..17f7661e1 100644 --- a/app/panel-android/components/content/__tests__/OverviewTab.jsx +++ b/app/panel-android/components/content/__tests__/OverviewTab.jsx @@ -24,8 +24,8 @@ describe('app/panel-android/components/content/OverviewTab.jsx', () => { const panel = { enable_ad_block: false, enable_anti_tracking: false, - enable_smart_block: false, - smartBlock: { blocked: {}, unblocked: {} }, + enable_smart_browse: false, + smartBrowse: { blocked: {}, unblocked: {} }, }; const summary = { categories: [], @@ -63,8 +63,8 @@ describe('app/panel-android/components/content/OverviewTab.jsx', () => { const panel = { enable_ad_block: true, enable_anti_tracking: true, - enable_smart_block: true, - smartBlock: { blocked: { 1: true }, unblocked: { 2: true, 3: true } }, + enable_smart_browse: true, + smartBrowse: { blocked: { 1: true }, unblocked: { 2: true, 3: true } }, }; const summary = { categories: ['ads', 'trackers'], @@ -104,8 +104,8 @@ describe('app/panel-android/components/content/OverviewTab.jsx', () => { const panel = { enable_ad_block: false, enable_anti_tracking: false, - enable_smart_block: false, - smartBlock: { blocked: {}, unblocked: {} }, + enable_smart_browse: false, + smartBrowse: { blocked: {}, unblocked: {} }, }; const summary = { categories: [], diff --git a/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap b/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap index b8330c0ba..b6fc57b6e 100644 --- a/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap +++ b/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap @@ -219,7 +219,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit off
trackers_blocked - + requests_modified - +
{ let count = 0; categoryEl.trackers.forEach((trackerEl) => { - const isSbBlocked = smartBlockActive && trackerEl.warningSmartBlock; + const isSbBlocked = smartBrowseActive && trackerEl.warningSmartBrowse; if ((trackerEl.blocked && !trackerEl.ss_allowed) || isSbBlocked || trackerEl.ss_blocked) { trackerEl.shouldShow = true; count++; @@ -325,8 +325,8 @@ class Blocking extends React.Component { selected_app_ids, show_tracker_urls, sitePolicy, - smartBlock, - smartBlockActive, + smartBrowse, + smartBrowseActive, } = this.props; const { @@ -342,8 +342,8 @@ class Blocking extends React.Component { sitePolicy={sitePolicy} paused_blocking={paused_blocking} selected_app_ids={selected_app_ids} - smartBlockActive={smartBlockActive} - smartBlock={smartBlock} + smartBrowseActive={smartBrowseActive} + smartBrowse={smartBrowse} /> {(disableBlocking && is_expanded) ? ( @@ -358,8 +358,8 @@ class Blocking extends React.Component { sitePolicy={sitePolicy} paused_blocking={paused_blocking} language={language} - smartBlockActive={smartBlockActive} - smartBlock={smartBlock} + smartBrowseActive={smartBrowseActive} + smartBrowse={smartBrowse} unknownCategory={unknownCategory} enable_anti_tracking={enable_anti_tracking} /> diff --git a/app/panel/components/Blocking/BlockingHeader.jsx b/app/panel/components/Blocking/BlockingHeader.jsx index 4ec56c338..3376ce441 100644 --- a/app/panel/components/Blocking/BlockingHeader.jsx +++ b/app/panel/components/Blocking/BlockingHeader.jsx @@ -91,7 +91,7 @@ class BlockingHeader extends React.Component { */ componentDidMount() { const { - actions, categories, smartBlock, smartBlockActive + actions, categories, smartBrowse, smartBrowseActive } = this.props; const { fromHere } = this.state; if (categories) { @@ -107,8 +107,8 @@ class BlockingHeader extends React.Component { if (typeof actions.updateTrackerCounts === 'function') { // if we're on GlobalSettings, we don't need to run this function - const calcSmartBlock = (smartBlockActive && smartBlock) || { blocked: {}, unblocked: {} }; - updateSummaryBlockingCount(categories, calcSmartBlock, actions.updateTrackerCounts); + const calcSmartBrowse = (smartBrowseActive && smartBrowse) || { blocked: {}, unblocked: {} }; + updateSummaryBlockingCount(categories, calcSmartBrowse, actions.updateTrackerCounts); } } @@ -134,8 +134,8 @@ class BlockingHeader extends React.Component { globalBlocking, paused_blocking, sitePolicy, - smartBlock, - smartBlockActive, + smartBrowse, + smartBrowseActive, showToast } = this.props; const globalBlockingBool = !!globalBlocking; @@ -147,15 +147,15 @@ class BlockingHeader extends React.Component { } actions.updateBlockAllTrackers({ - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, allBlocked, }); if (typeof actions.updateTrackerCounts === 'function') { // if we're on GlobalSettings, we don't need to run this function - const calcSmartBlock = (smartBlockActive && smartBlock) || { blocked: {}, unblocked: {} }; - updateSummaryBlockingCount(categories, calcSmartBlock, actions.updateTrackerCounts); + const calcSmartBrowse = (smartBrowseActive && smartBrowse) || { blocked: {}, unblocked: {} }; + updateSummaryBlockingCount(categories, calcSmartBrowse, actions.updateTrackerCounts); } actions.showNotification({ diff --git a/app/panel/components/Blocking/Categories.jsx b/app/panel/components/Blocking/Categories.jsx index 3c5dd05b7..c8d4e6f86 100644 --- a/app/panel/components/Blocking/Categories.jsx +++ b/app/panel/components/Blocking/Categories.jsx @@ -42,8 +42,8 @@ class Categories extends React.Component { show_tracker_urls, paused_blocking, language, - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, } = this.props; const globalBlockingBool = !!globalBlocking; const filteredBool = !!filtered; @@ -95,8 +95,8 @@ class Categories extends React.Component { sitePolicy={sitePolicy} paused_blocking={paused_blocking} language={language} - smartBlockActive={smartBlockActive} - smartBlock={smartBlock} + smartBrowseActive={smartBrowseActive} + smartBrowse={smartBrowse} enable_anti_tracking={enable_anti_tracking} isUnknown={isUnknown} /> diff --git a/app/panel/components/Blocking/Category.jsx b/app/panel/components/Blocking/Category.jsx index 513107107..644b8c0e2 100644 --- a/app/panel/components/Blocking/Category.jsx +++ b/app/panel/components/Blocking/Category.jsx @@ -146,8 +146,8 @@ class Category extends React.Component { globalBlocking, sitePolicy, paused_blocking, - smartBlock, - smartBlockActive, + smartBrowse, + smartBrowseActive, showToast } = this.props; const { allShownBlocked } = this.state; @@ -159,8 +159,8 @@ class Category extends React.Component { } actions.updateCategoryBlocked({ - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, category: category.id, blocked, }); @@ -225,8 +225,8 @@ class Category extends React.Component { showToast, show_tracker_urls, language, - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, } = this.props; const { totalShownBlocked, @@ -335,8 +335,8 @@ class Category extends React.Component { sitePolicy={sitePolicy} paused_blocking={paused_blocking} language={language} - smartBlockActive={smartBlockActive} - smartBlock={smartBlock} + smartBrowseActive={smartBrowseActive} + smartBrowse={smartBrowse} isUnknown={isUnknown} /> )} diff --git a/app/panel/components/Blocking/Tracker.jsx b/app/panel/components/Blocking/Tracker.jsx index a74ed851d..b6a586cd3 100644 --- a/app/panel/components/Blocking/Tracker.jsx +++ b/app/panel/components/Blocking/Tracker.jsx @@ -64,9 +64,9 @@ class Tracker extends React.Component { classes.push((tracker.blocked) ? 'blocked' : ''); classes.push((tracker.ss_allowed) ? 'individual-trust' : ''); classes.push((tracker.ss_blocked) ? 'individual-restrict' : ''); - classes.push((tracker.warningCompatibility || tracker.warningInsecure || tracker.warningSlow || tracker.warningSmartBlock) ? 'warning' : ''); - if (tracker.warningSmartBlock) { - classes.push(tracker.warningSmartBlock === 'blocked' ? 'smart-blocked' : 'smart-unblocked'); + classes.push((tracker.warningCompatibility || tracker.warningInsecure || tracker.warningSlow || tracker.warningSmartBrowse) ? 'warning' : ''); + if (tracker.warningSmartBrowse) { + classes.push(tracker.warningSmartBrowse === 'blocked' ? 'smart-blocked' : 'smart-unblocked'); } else { classes.push((tracker.warningCompatibility) ? 'compatibility' : ''); classes.push((tracker.warningInsecure) ? 'insecure' : ''); @@ -74,8 +74,8 @@ class Tracker extends React.Component { } // Create tooltips for tracker alerts - if (tracker.warningSmartBlock) { - updated_title = tracker.warningSmartBlock === 'blocked' ? t('panel_tracker_warning_smartblock_tooltip') : t('panel_tracker_warning_smartunblock_tooltip'); + if (tracker.warningSmartBrowse) { + updated_title = tracker.warningSmartBrowse === 'blocked' ? t('panel_tracker_warning_smartbrowse_tooltip') : t('panel_tracker_warning_smartunblock_tooltip'); } else if (tracker.warningCompatibility) { updated_title = t('panel_tracker_warning_compatibility_tooltip'); } else if (tracker.warningInsecure && tracker.warningSlow) { @@ -194,8 +194,8 @@ class Tracker extends React.Component { tracker, paused_blocking, sitePolicy, - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, cat_id, } = this.props; const blocked = !tracker.blocked; @@ -205,8 +205,8 @@ class Tracker extends React.Component { } actions.updateTrackerBlocked({ - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, app_id: tracker.id, cat_id, blocked, diff --git a/app/panel/components/Blocking/Trackers.jsx b/app/panel/components/Blocking/Trackers.jsx index 9bb8ce9ff..b049313a0 100644 --- a/app/panel/components/Blocking/Trackers.jsx +++ b/app/panel/components/Blocking/Trackers.jsx @@ -51,8 +51,8 @@ class Trackers extends React.Component { show_tracker_urls, sitePolicy, paused_blocking, - smartBlockActive, - smartBlock, + smartBrowseActive, + smartBrowse, } = this.props; let trackerList; if (globalBlocking) { @@ -85,8 +85,8 @@ class Trackers extends React.Component { sitePolicy={sitePolicy} paused_blocking={paused_blocking} language={language} - smartBlockActive={smartBlockActive} - smartBlock={smartBlock} + smartBrowseActive={smartBrowseActive} + smartBrowse={smartBrowse} isUnknown={isUnknown} /> )); diff --git a/app/panel/components/BuildingBlocks/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/CliqzFeature.jsx index 5b98c28fd..2a900b5eb 100644 --- a/app/panel/components/BuildingBlocks/CliqzFeature.jsx +++ b/app/panel/components/BuildingBlocks/CliqzFeature.jsx @@ -40,8 +40,8 @@ class CliqzFeature extends React.Component { return t('tooltip_ad_block_on'); case 'anti_track': return t('tooltip_anti_track_on'); - case 'smart_block': - return t('tooltip_smart_block_on'); + case 'smart_browse': + return t('tooltip_smart_browse_on'); default: return false; } @@ -51,7 +51,7 @@ class CliqzFeature extends React.Component { return t('ad_blocking_DESC'); case 'anti_track': return t('anti_tracking_DESC'); - case 'smart_block': + case 'smart_browse': return t('smart_browsing_DESC'); default: return false; @@ -67,7 +67,7 @@ class CliqzFeature extends React.Component { return t('ad_blocking'); case 'anti_track': return t('anti_tracking'); - case 'smart_block': + case 'smart_browse': return t('smart_browsing'); default: return false; @@ -140,7 +140,7 @@ class CliqzFeature extends React.Component { featureName = t('anti_tracking'); } else if (featureType === 'ad_block') { featureName = t('ad_blocking'); - } else if (featureType === 'smart_block') { + } else if (featureType === 'smart_browse') { featureName = t('smart_browsing'); } @@ -168,7 +168,7 @@ CliqzFeature.propTypes = { type: PropTypes.oneOf([ 'anti_track', 'ad_block', - 'smart_block', + 'smart_browse', ]).isRequired, active: PropTypes.bool, cliqzInactive: PropTypes.oneOfType([ diff --git a/app/panel/components/BuildingBlocks/__tests__/CliqzFeature.jsx b/app/panel/components/BuildingBlocks/__tests__/CliqzFeature.jsx index cba12eac1..8a4fde87f 100644 --- a/app/panel/components/BuildingBlocks/__tests__/CliqzFeature.jsx +++ b/app/panel/components/BuildingBlocks/__tests__/CliqzFeature.jsx @@ -49,7 +49,7 @@ describe('app/panel/components/CliqzFeature.jsx', () => { /> {}} - type="smart_block" + type="smart_browse" active={false} cliqzInactive={false} isSmaller={false} @@ -86,7 +86,7 @@ describe('app/panel/components/CliqzFeature.jsx', () => { /> {}} - type="smart_block" + type="smart_browse" active cliqzInactive isSmaller={false} @@ -127,7 +127,7 @@ describe('app/panel/components/CliqzFeature.jsx', () => { /> {}} - type="smart_block" + type="smart_browse" active cliqzInactive isSmaller @@ -148,7 +148,7 @@ describe('app/panel/components/CliqzFeature.jsx', () => { const component = shallow(
{this._renderCliqzAntiTracking()} {this._renderCliqzAdBlock()} - {this._renderCliqzSmartBlock()} + {this._renderCliqzSmartBrowse()}
{this._renderStatsNavicon()} {enable_offers && this._renderRewardsNavicon()} diff --git a/app/panel/containers/BlockingContainer.js b/app/panel/containers/BlockingContainer.js index ab4509022..4460e047a 100644 --- a/app/panel/containers/BlockingContainer.js +++ b/app/panel/containers/BlockingContainer.js @@ -30,12 +30,12 @@ const mapStateToProps = state => ({ ...state.blocking, is_expanded: state.panel.is_expanded, language: state.panel.language, - smartBlock: state.panel.smartBlock, + smartBrowse: state.panel.smartBrowse, enable_anti_tracking: state.panel.enable_anti_tracking, pageHost: state.summary.pageHost, paused_blocking: state.summary.paused_blocking, sitePolicy: state.summary.sitePolicy, - smartBlockActive: state.panel.enable_smart_block + smartBrowseActive: state.panel.enable_smart_browse }); /** * Bind Blocking view component action creators using Redux's bindActionCreators diff --git a/app/panel/reducers/panel.js b/app/panel/reducers/panel.js index 945b0a872..e3f5f9b1a 100644 --- a/app/panel/reducers/panel.js +++ b/app/panel/reducers/panel.js @@ -40,7 +40,7 @@ import { setTheme } from '../utils/utils'; const initialState = { enable_ad_block: true, enable_anti_tracking: true, - enable_smart_block: true, + enable_smart_browse: true, initialized: false, // prevent rendering subviews before UPDATE_PANEL_DATA resolves is_expanded: false, is_expert: false, @@ -317,8 +317,8 @@ export default (state = initialState, action) => { case 'enable_ad_block': pingName = action.data.isEnabled ? 'adblock_off' : 'adblock_on'; break; - case 'enable_smart_block': - pingName = action.data.isEnabled ? 'smartblock_off' : 'smartblock_on'; + case 'enable_smart_browse': + pingName = action.data.isEnabled ? 'smartbrowse_off' : 'smartbrowse_on'; break; default: break; diff --git a/app/panel/utils/blocking.js b/app/panel/utils/blocking.js index d3166355d..af440c723 100644 --- a/app/panel/utils/blocking.js +++ b/app/panel/utils/blocking.js @@ -19,10 +19,10 @@ import { sendMessage } from './msg'; * Dispatch action to SummaryActions to update trackerCounts. * @memberOf PanelUtils * @param {array} categories array of categories - * @param {object} smartBlock blocked and unblocked of Smart Blocking + * @param {object} smartBrowse blocked and unblocked of Smart Blocking * @param {function} updateTrackerCounts from SummaryActions */ -export function updateSummaryBlockingCount(categories = [], smartBlock, updateTrackerCounts) { +export function updateSummaryBlockingCount(categories = [], smartBrowse, updateTrackerCounts) { let numTotal = 0; let numTotalBlocked = 0; let numTotalSsBlocked = 0; @@ -33,8 +33,8 @@ export function updateSummaryBlockingCount(categories = [], smartBlock, updateTr categories.forEach((categoryEl) => { categoryEl.trackers.forEach((trackerEl) => { numTotal++; - const sbBlocked = smartBlock.blocked.hasOwnProperty(trackerEl.id); - const sbUnblocked = smartBlock.unblocked.hasOwnProperty(trackerEl.id); + const sbBlocked = smartBrowse.blocked.hasOwnProperty(trackerEl.id); + const sbUnblocked = smartBrowse.unblocked.hasOwnProperty(trackerEl.id); if (trackerEl.ss_blocked || sbBlocked || (trackerEl.blocked && !trackerEl.ss_allowed && !sbUnblocked)) { numTotalBlocked++; @@ -75,14 +75,14 @@ export function updateBlockAllTrackers(state, action) { const blocked = !action.data.allBlocked; const updated_app_ids = JSON.parse(JSON.stringify(state.selected_app_ids)) || {}; const updated_categories = JSON.parse(JSON.stringify(state.categories)) || []; - const { smartBlockActive } = action.data; - const smartBlock = (smartBlockActive && action.data.smartBlock) || { blocked: {}, unblocked: {} }; + const { smartBrowseActive } = action.data; + const smartBrowse = (smartBrowseActive && action.data.smartBrowse) || { blocked: {}, unblocked: {} }; updated_categories.forEach((categoryEl) => { categoryEl.num_blocked = 0; categoryEl.trackers.forEach((trackerEl) => { - const sbBlocked = smartBlock.blocked.hasOwnProperty(trackerEl.id); - const sbUnblocked = smartBlock.unblocked.hasOwnProperty(trackerEl.id); + const sbBlocked = smartBrowse.blocked.hasOwnProperty(trackerEl.id); + const sbUnblocked = smartBrowse.unblocked.hasOwnProperty(trackerEl.id); if (trackerEl.shouldShow) { trackerEl.blocked = blocked; @@ -116,16 +116,16 @@ export function updateBlockAllTrackers(state, action) { * @return {Object} updated categories and selected app ids */ export function updateCategoryBlocked(state, action) { - const { blocked, smartBlockActive } = action.data; - const smartBlock = (smartBlockActive && action.data.smartBlock) || { blocked: {}, unblocked: {} }; + const { blocked, smartBrowseActive } = action.data; + const smartBrowse = (smartBrowseActive && action.data.smartBrowse) || { blocked: {}, unblocked: {} }; const updated_app_ids = JSON.parse(JSON.stringify(state.selected_app_ids)) || {}; const updated_categories = JSON.parse(JSON.stringify(state.categories)); // deep clone const catIndex = updated_categories.findIndex(item => item.id === action.data.category); const updated_category = updated_categories[catIndex]; updated_category.num_blocked = 0; updated_category.trackers.forEach((trackerEl) => { - const sbBlocked = smartBlock.blocked.hasOwnProperty(trackerEl.id); - const sbUnblocked = smartBlock.unblocked.hasOwnProperty(trackerEl.id); + const sbBlocked = smartBrowse.blocked.hasOwnProperty(trackerEl.id); + const sbUnblocked = smartBrowse.unblocked.hasOwnProperty(trackerEl.id); if (trackerEl.shouldShow) { trackerEl.blocked = blocked; @@ -185,8 +185,8 @@ export function updateTrackerBlocked(state, action) { return {}; } - const { blocked, smartBlockActive } = action.data; - const smartBlock = (smartBlockActive && action.data.smartBlock) || { blocked: {}, unblocked: {} }; + const { blocked, smartBrowseActive } = action.data; + const smartBrowse = (smartBrowseActive && action.data.smartBrowse) || { blocked: {}, unblocked: {} }; const updated_app_ids = JSON.parse(JSON.stringify(state.selected_app_ids)) || {}; const updated_categories = JSON.parse(JSON.stringify(state.categories)) || []; // deep clone const catIndex = updated_categories.findIndex(item => item.id === action.data.cat_id); @@ -194,8 +194,8 @@ export function updateTrackerBlocked(state, action) { updated_category.num_blocked = 0; updated_category.trackers.forEach((trackerEl) => { - const sbBlocked = smartBlock.blocked.hasOwnProperty(trackerEl.id); - const sbUnblocked = smartBlock.unblocked.hasOwnProperty(trackerEl.id); + const sbBlocked = smartBrowse.blocked.hasOwnProperty(trackerEl.id); + const sbUnblocked = smartBrowse.unblocked.hasOwnProperty(trackerEl.id); if (trackerEl.shouldShow) { if (trackerEl.id === action.data.app_id) { diff --git a/app/scss/android/_blocking_tab.scss b/app/scss/android/_blocking_tab.scss index d876f5b93..20df07ea2 100644 --- a/app/scss/android/_blocking_tab.scss +++ b/app/scss/android/_blocking_tab.scss @@ -211,13 +211,13 @@ } } - .OverrideSmartBlock { + .OverrideSmartBrowse { position: relative; cursor: pointer; height: 25px; width: 25px; margin-right: 5px; - background-image: buildIconSmartBlocking($ghosty-blue); + background-image: buildIconSmartBrowsing($ghosty-blue); background-size: 40px 40px; background-position: center; } diff --git a/app/scss/android/_overview_tab.scss b/app/scss/android/_overview_tab.scss index 16ccb95f5..8523289d5 100644 --- a/app/scss/android/_overview_tab.scss +++ b/app/scss/android/_overview_tab.scss @@ -114,7 +114,7 @@ .CliqzFeature__status { color: $cliqz-feature--blue; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--blue); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--blue); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--blue); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--blue); } .CliqzFeature__feature-name { color: $cliqz-feature--blue; } } } @@ -124,7 +124,7 @@ .CliqzFeature__status { color: $cliqz-feature--gray; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--gray); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--gray); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--gray); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--gray); } .CliqzFeature__feature-name { color: $cliqz-feature--gray; } } } diff --git a/app/scss/partials/_blocking.scss b/app/scss/partials/_blocking.scss index a9f995c28..ec0303ddf 100644 --- a/app/scss/partials/_blocking.scss +++ b/app/scss/partials/_blocking.scss @@ -76,7 +76,7 @@ } &.smart-blocked .warning-image, &.smart-unblocked .warning-image { - background-image: buildIconSmartBlockingNoCircle(#1dafed); + background-image: buildIconSmartBrowsingNoCircle(#1dafed); } } } diff --git a/app/scss/partials/_cliqz_feature.scss b/app/scss/partials/_cliqz_feature.scss index d88f0b5e2..e7f228d97 100644 --- a/app/scss/partials/_cliqz_feature.scss +++ b/app/scss/partials/_cliqz_feature.scss @@ -96,14 +96,14 @@ $cliqz-feature--darker-gray: #a4a4a4; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--blue); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--blue); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--blue); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--blue); } .CliqzFeature__feature-name { color: $cliqz-feature--blue; } &:hover { .CliqzFeature__status { color: $cliqz-feature--darker-blue; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--darker-blue); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--darker-blue); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--darker-blue); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--darker-blue); } .CliqzFeature__feature-name { color: $cliqz-feature--darker-blue; } } } @@ -112,7 +112,7 @@ $cliqz-feature--darker-gray: #a4a4a4; .CliqzFeature__status { color: $cliqz-feature--pale-blue; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--pale-blue); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--pale-blue); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--pale-blue); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--pale-blue); } .CliqzFeature__feature-name { color: $cliqz-feature--pale-blue; } } @@ -121,14 +121,14 @@ $cliqz-feature--darker-gray: #a4a4a4; .CliqzFeature__status { color: $cliqz-feature--gray; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--gray); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--gray); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--gray); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--gray); } .CliqzFeature__feature-name { color: $cliqz-feature--gray; } &:hover { .CliqzFeature__status { color: $cliqz-feature--darker-gray; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--darker-gray); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--darker-gray); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--darker-gray); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--darker-gray); } .CliqzFeature__feature-name { color: $cliqz-feature--darker-gray; } } } @@ -137,6 +137,6 @@ $cliqz-feature--darker-gray: #a4a4a4; .CliqzFeature__status { color: $cliqz-feature--light-gray; } .CliqzFeature__icon--anti-track { background-image: buildIconAntiTracking($cliqz-feature--light-gray); } .CliqzFeature__icon--ad-block { background-image: buildIconAdBlocking($cliqz-feature--light-gray); } - .CliqzFeature__icon--smart-block { background-image: buildIconSmartBlocking($cliqz-feature--light-gray); } + .CliqzFeature__icon--smart-browse { background-image: buildIconSmartBrowsing($cliqz-feature--light-gray); } .CliqzFeature__feature-name { color: $cliqz-feature--light-gray; } } diff --git a/app/scss/partials/_svgs.scss b/app/scss/partials/_svgs.scss index 80029dd58..8a51caae9 100644 --- a/app/scss/partials/_svgs.scss +++ b/app/scss/partials/_svgs.scss @@ -12,7 +12,7 @@ */ // Used in Blocking -@function buildIconSmartBlockingNoCircle($stroke-color) { +@function buildIconSmartBrowsingNoCircle($stroke-color) { @return url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2250%22%20height%3D%2250%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20fill%3D%22#{url-friendly-colour($stroke-color)}%22%20d%3D%22M31.977%2020.24c-.097%201.677-.697%203.156-1.654%204.514-.43.61-.867%201.217-1.285%201.84-.597.887-1.074%201.832-1.258%202.898-.03.175-.141.162-.263.162l-2.525-.001c-.832%200-1.663-.005-2.497.003-.181.002-.246-.05-.283-.238-.197-1.031-.657-1.954-1.241-2.818-.497-.733-1.015-1.454-1.514-2.187A8.257%208.257%200%200%201%2018.011%2020c-.112-2.82%201.486-5.279%204.185-6.42%203.458-1.462%207.547.004%209.166%203.293.521%201.062.682%202.19.615%203.365zM22.352%2032.3v-.63h5.305v.63h-5.305zm4.76%202.681h-4.216c-.508%200-.602-.108-.536-.653h5.28c.075.537-.022.653-.529.653zm6.238-18.576c-1.449-3.169-3.966-4.928-7.385-5.335-2.913-.348-5.446.61-7.511%202.673-2.305%202.306-2.858%205.124-2.19%208.241.351%201.63%201.149%203.046%202.104%204.39.438.617.869%201.243%201.271%201.883.372.593.635%201.241.661%201.946.03.814.008%201.627.008%202.441h.032c0%20.676-.001%201.351.002%202.027.006%201.204.952%202.22%202.15%202.3.158.01.21.056.25.214a2.322%202.322%200%200%200%204.524-.007c.034-.14.072-.194.225-.206a2.329%202.329%200%200%200%202.174-2.337c0-1.257.01-2.515-.003-3.774-.011-.941.208-1.816.706-2.61.402-.64.832-1.268%201.274-1.88%201.263-1.757%202.155-3.653%202.323-5.844.109-1.423-.018-2.816-.615-4.122z%22/%3E%3Cpath%20stroke%3D%22#{url-friendly-colour($stroke-color)}%22%20stroke-width%3D%221.5%22%20fill%3D%22none%22%20d%3D%22M25.096%2018.214a.324.324%200%200%200-.192%200l-4.117%201.092a.37.37%200%200%200-.287.364c.02%202.932%201.59%205.652%204.29%207.472a.387.387%200%200%200%20.21.058c.077%200%20.153-.02.21-.058%202.7-1.82%204.27-4.54%204.29-7.472a.37.37%200%200%200-.287-.364l-4.117-1.092z%22/%3E%3C/svg%3E'); } @@ -28,7 +28,7 @@ } // Used in Cliqz Features -@function buildIconSmartBlocking($stroke-color) { +@function buildIconSmartBrowsing($stroke-color) { @return url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2250%22%20height%3D%2250%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ccircle%20stroke%3D%22#{url-friendly-colour($stroke-color)}%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20cx%3D%2225%22%20cy%3D%2225%22%20r%3D%2223%22/%3E%3Cpath%20fill%3D%22#{url-friendly-colour($stroke-color)}%22%20d%3D%22M31.977%2020.24c-.097%201.677-.697%203.156-1.654%204.514-.43.61-.867%201.217-1.285%201.84-.597.887-1.074%201.832-1.258%202.898-.03.175-.141.162-.263.162l-2.525-.001c-.832%200-1.663-.005-2.497.003-.181.002-.246-.05-.283-.238-.197-1.031-.657-1.954-1.241-2.818-.497-.733-1.015-1.454-1.514-2.187A8.257%208.257%200%200%201%2018.011%2020c-.112-2.82%201.486-5.279%204.185-6.42%203.458-1.462%207.547.004%209.166%203.293.521%201.062.682%202.19.615%203.365zM22.352%2032.3v-.63h5.305v.63h-5.305zm4.76%202.681h-4.216c-.508%200-.602-.108-.536-.653h5.28c.075.537-.022.653-.529.653zm6.238-18.576c-1.449-3.169-3.966-4.928-7.385-5.335-2.913-.348-5.446.61-7.511%202.673-2.305%202.306-2.858%205.124-2.19%208.241.351%201.63%201.149%203.046%202.104%204.39.438.617.869%201.243%201.271%201.883.372.593.635%201.241.661%201.946.03.814.008%201.627.008%202.441h.032c0%20.676-.001%201.351.002%202.027.006%201.204.952%202.22%202.15%202.3.158.01.21.056.25.214a2.322%202.322%200%200%200%204.524-.007c.034-.14.072-.194.225-.206a2.329%202.329%200%200%200%202.174-2.337c0-1.257.01-2.515-.003-3.774-.011-.941.208-1.816.706-2.61.402-.64.832-1.268%201.274-1.88%201.263-1.757%202.155-3.653%202.323-5.844.109-1.423-.018-2.816-.615-4.122z%22/%3E%3Cpath%20stroke%3D%22#{url-friendly-colour($stroke-color)}%22%20stroke-width%3D%221.5%22%20fill%3D%22none%22%20d%3D%22M25.096%2018.214a.324.324%200%200%200-.192%200l-4.117%201.092a.37.37%200%200%200-.287.364c.02%202.932%201.59%205.652%204.29%207.472a.387.387%200%200%200%20.21.058c.077%200%20.153-.02.21-.058%202.7-1.82%204.27-4.54%204.29-7.472a.37.37%200%200%200-.287-.364l-4.117-1.092z%22/%3E%3C/svg%3E'); } diff --git a/src/background.js b/src/background.js index 1644488a0..fa2b3a66a 100644 --- a/src/background.js +++ b/src/background.js @@ -668,7 +668,7 @@ function handleGhosteryHub(name, message, callback) { case 'SET_SETUP_SHOW_WARNING_OVERRIDE': case 'SET_ANTI_TRACKING': case 'SET_AD_BLOCK': - case 'SET_SMART_BLOCK': + case 'SET_SMART_BROWSE': case 'SET_HUMAN_WEB': case 'SET_SETUP_COMPLETE': { panelData.set(message); @@ -1575,7 +1575,7 @@ function initializeVersioning() { if (prevVersion[0] < 8) { globals.JUST_UPGRADED_FROM_7 = true; conf.is_expert = true; - conf.enable_smart_block = false; + conf.enable_smart_browse = false; } // Check if the earliest version is < 8.4.2 diff --git a/src/classes/ConfData.js b/src/classes/ConfData.js index 990db8cd4..220094853 100644 --- a/src/classes/ConfData.js +++ b/src/classes/ConfData.js @@ -114,7 +114,7 @@ class ConfData { _initProperty('enable_metrics', false); _initProperty('enable_offers', !IS_CLIQZ && !IS_FIREFOX && !IS_ANDROID); _initProperty('enable_abtests', true); - _initProperty('enable_smart_block', true); + _initProperty('enable_smart_browse', true); _initProperty('expand_all_trackers', true); _initProperty('hide_alert_trusted', false); _initProperty('hub_layout', 'not_yet_set'); diff --git a/src/classes/Debugger.js b/src/classes/Debugger.js index 64f204d07..236a5db5e 100644 --- a/src/classes/Debugger.js +++ b/src/classes/Debugger.js @@ -339,7 +339,7 @@ class Debugger { [`${CSS_SUBHEADER}When called with...`, 'Returns...'], ['No argument', 'The whole config object'], ['A property key string', 'An object with just that property'], - ['', "Example: ghostery.getConfData('enable_smart_block')"], + ['', "Example: ghostery.getConfData('enable_smart_browse')"], ['A property key regex', 'An object with all matching properties'], ['', 'Example: ghostery.getConfData(/setup_/)'], ['Anything else', 'The whole config object. Also returned if there are no matching results'], diff --git a/src/classes/EventHandlers.js b/src/classes/EventHandlers.js index ccba49597..d5a5d4554 100644 --- a/src/classes/EventHandlers.js +++ b/src/classes/EventHandlers.js @@ -27,7 +27,7 @@ import globals from './Globals'; import latency from './Latency'; import panelData from './PanelData'; import Policy, { BLOCK_REASON_SS_UNBLOCKED, BLOCK_REASON_C2P_ALLOWED_THROUGH } from './Policy'; -import PolicySmartBlock from './PolicySmartBlock'; +import PolicySmartBrowse from './PolicySmartBrowse'; import PurpleBox from './PurpleBox'; import surrogatedb from './SurrogateDb'; import tabInfo from './TabInfo'; @@ -43,7 +43,7 @@ import * as utils from '../utils/utils'; */ class EventHandlers { constructor() { - this.policySmartBlock = new PolicySmartBlock(); + this.policySmartBrowse = new PolicySmartBrowse(); this.purplebox = new PurpleBox(); this._pageListeners = new Set(); @@ -368,7 +368,7 @@ class EventHandlers { /* ** SMART BLOCKING - Privacy ** */ // block HTTP request on HTTPS page - if (PolicySmartBlock.isInsecureRequest(tab_id, page_protocol, processed.scheme, processed.hostname)) { + if (PolicySmartBrowse.isInsecureRequest(tab_id, page_protocol, processed.scheme, processed.hostname)) { return EventHandlers._blockHelper(eventMutable, tab_id, null, null, request_id, from_redirect, true); } @@ -389,7 +389,7 @@ class EventHandlers { /* ** SMART BLOCKING - Breakage ** */ // allow first party trackers - if (PolicySmartBlock.isFirstPartyRequest(tab_id, page_domain, processed.generalDomain)) { + if (PolicySmartBrowse.isFirstPartyRequest(tab_id, page_domain, processed.generalDomain)) { return { cancel: false }; } @@ -418,8 +418,8 @@ class EventHandlers { }; } - const smartBlocked = !block ? this.policySmartBlock.shouldBlock(app_id, cat_id, tab_id, page_url, eventMutable.type, eventMutable.timeStamp) : false; - const smartUnblocked = block ? this.policySmartBlock.shouldUnblock(app_id, cat_id, tab_id, page_url, eventMutable.type) : false; + const smartBrowseed = !block ? this.policySmartBrowse.shouldBlock(app_id, cat_id, tab_id, page_url, eventMutable.type, eventMutable.timeStamp) : false; + const smartUnblocked = block ? this.policySmartBrowse.shouldUnblock(app_id, cat_id, tab_id, page_url, eventMutable.type) : false; // process the tracker asynchronously // very important to block request processing as little as necessary @@ -430,14 +430,14 @@ class EventHandlers { type: eventMutable.type, url: eventMutable.url, block, - smartBlocked, + smartBrowseed, tab_id, from_frame: eventMutable.parentFrameId !== -1, request_id }); }, 1); - if ((block && !smartUnblocked) || smartBlocked) { + if ((block && !smartUnblocked) || smartBrowseed) { return EventHandlers._blockHelper(eventMutable, tab_id, app_id, bug_id, request_id, fromRedirect); } @@ -592,14 +592,14 @@ class EventHandlers { */ _processBug(details) { const { - bug_id, app_id, type, url, block, smartBlocked, tab_id, request_id + bug_id, app_id, type, url, block, smartBrowseed, tab_id, request_id } = details; const tab = tabInfo.getTabInfo(tab_id); const allowedOnce = c2pDb.allowedOnce(details.tab_id, app_id); let num_apps_old; - log((block || smartBlocked ? 'Blocked' : 'Found'), type, url); + log((block || smartBrowseed ? 'Blocked' : 'Found'), type, url); log(`^^^ Pattern ID ${bug_id} on tab ID ${tab_id}`); if (conf.show_alert) { @@ -613,7 +613,7 @@ class EventHandlers { // throttled in PanelData panelData.updatePanelUI(); - if ((block || smartBlocked) && (conf.enable_click2play || conf.enable_click2playSocial) && !allowedOnce) { + if ((block || smartBrowseed) && (conf.enable_click2play || conf.enable_click2playSocial) && !allowedOnce) { buildC2P(details, app_id); } diff --git a/src/classes/Globals.js b/src/classes/Globals.js index c98ed82be..bbf99b5b5 100644 --- a/src/classes/Globals.js +++ b/src/classes/Globals.js @@ -104,7 +104,7 @@ class Globals { 'enable_metrics', 'enable_offers', 'enable_abtests', - 'enable_smart_block', + 'enable_smart_browse', 'expand_all_trackers', 'hide_alert_trusted', 'ignore_first_party', diff --git a/src/classes/Metrics.js b/src/classes/Metrics.js index e9c9cd31b..2fdddc997 100644 --- a/src/classes/Metrics.js +++ b/src/classes/Metrics.js @@ -123,8 +123,8 @@ class Metrics { case 'create_account_setup': case 'list_dash': case 'pause_snooze': - case 'smartblock_off': - case 'smartblock_on': + case 'smartbrowse_off': + case 'smartbrowse_on': case 'viewchange_from_detailed': case 'viewchange_from_expanded': case 'viewchange_from_simple': @@ -260,7 +260,7 @@ class Metrics { // Adblocking state `&ab=${encodeURIComponent(conf.enable_ad_block ? '1' : '0')}` + // Smartblocking state - `&sm=${encodeURIComponent(conf.enable_smart_block ? '1' : '0')}` + + `&sm=${encodeURIComponent(conf.enable_smart_browse ? '1' : '0')}` + // Antitracking state `&at=${encodeURIComponent(conf.enable_anti_tracking ? '1' : '0')}` + // The deepest setup page reached by user during setup diff --git a/src/classes/PanelData.js b/src/classes/PanelData.js index c47f542d1..ad215dbba 100644 --- a/src/classes/PanelData.js +++ b/src/classes/PanelData.js @@ -304,22 +304,22 @@ class PanelData { }; } - // TODO: Determine whether needsReload and/or smartBlock ever actually change! + // TODO: Determine whether needsReload and/or smartBrowse ever actually change! /** * Gets panel data that may change when a new tracker is found * @param {number} tabId - * @return {Object} new needsReload and smartBlock values from tabInfo + * @return {Object} new needsReload and smartBrowse values from tabInfo */ _getDynamicPanelData(tabId) { const id = tabId || (this._activeTab && this._activeTab.id) || null; - const { needsReload, smartBlock } = + const { needsReload, smartBrowse } = tabInfo.getTabInfo(id) || - { needsReload: false, smartBlock: { blocked: {}, unblocked: {} } }; + { needsReload: false, smartBrowse: { blocked: {}, unblocked: {} } }; return { needsReload: needsReload || { changes: {} }, - smartBlock, + smartBrowse, account: PanelData._getCurrentAccount(), }; } @@ -350,7 +350,7 @@ class PanelData { const { id: tab_id } = this._activeTab; const { - current_theme, enable_ad_block, enable_anti_tracking, enable_smart_block, + current_theme, enable_ad_block, enable_anti_tracking, enable_smart_browse, enable_offers, is_expanded, is_expert, language, reload_banner_status, trackers_banner_status, } = conf; @@ -359,7 +359,7 @@ class PanelData { current_theme, enable_ad_block, enable_anti_tracking, - enable_smart_block, + enable_smart_browse, enable_offers, is_expanded, is_expert, @@ -473,7 +473,7 @@ class PanelData { */ static _getUserSettingsForPanelView(userSettings) { const { - current_theme, enable_ad_block, enable_anti_tracking, enable_smart_block, + current_theme, enable_ad_block, enable_anti_tracking, enable_smart_browse, enable_offers, is_expanded, is_expert, reload_banner_status, trackers_banner_status, } = userSettings; @@ -481,7 +481,7 @@ class PanelData { current_theme, enable_ad_block, enable_anti_tracking, - enable_smart_block, + enable_smart_browse, enable_offers, is_expanded, is_expert, @@ -660,10 +660,10 @@ class PanelData { if (!this._activeTab) { return []; } const categories = {}; - const smartBlock = tabInfo.getTabInfo(this._activeTab.id, 'smartBlock'); + const smartBrowse = tabInfo.getTabInfo(this._activeTab.id, 'smartBrowse'); this._trackerList.forEach((tracker) => { - const trackerState = this._getTrackerState(tracker, smartBlock); + const trackerState = this._getTrackerState(tracker, smartBrowse); let { cat } = tracker; if (t(`category_${cat}`) === `category_${cat}`) { @@ -676,7 +676,7 @@ class PanelData { } else { categories[cat] = PanelData._buildCategory(cat, trackerState); } - categories[cat].trackers.push(PanelData._buildTracker(tracker, trackerState, smartBlock)); + categories[cat].trackers.push(PanelData._buildTracker(tracker, trackerState, smartBrowse)); }); const categoryArray = Object.values(categories); @@ -726,10 +726,10 @@ class PanelData { * @private * @param {Object} tracker * @param {Object} trackerState - * @param {Object} smartBlock smart blocking stats for the active tab + * @param {Object} smartBrowse smart blocking stats for the active tab * @return {Object} object of tracker data */ - static _buildTracker(tracker, trackerState, smartBlock) { + static _buildTracker(tracker, trackerState, smartBrowse) { const { cat, cliqzAdCount, @@ -757,7 +757,7 @@ class PanelData { warningCompatibility: hasCompatibilityIssue, warningInsecure: hasInsecureIssue, warningSlow: hasLatencyIssue, - warningSmartBlock: (smartBlock.blocked.hasOwnProperty(id) && 'blocked') || (smartBlock.unblocked.hasOwnProperty(id) && 'unblocked') || false, + warningSmartBrowse: (smartBrowse.blocked.hasOwnProperty(id) && 'blocked') || (smartBrowse.unblocked.hasOwnProperty(id) && 'unblocked') || false, cliqzAdCount, cliqzCookieCount, cliqzFingerprintCount, @@ -769,14 +769,14 @@ class PanelData { * Computes the various blocked/allowed states for a given tracker * @private * @param {Object} tracker - * @param {Object} smartBlock + * @param {Object} smartBrowse * @return {Object} the tracker's blocked/allowed states */ - _getTrackerState({ id: trackerId }, smartBlock) { + _getTrackerState({ id: trackerId }, smartBrowse) { const { pageHost } = this._activeTab; const { selected_app_ids: selectedAppIds, - enable_smart_block: smartBlockActive + enable_smart_browse: smartBrowseActive } = conf; const pageUnblocks = (pageHost && conf.site_specific_unblocks[pageHost]) || []; const pageBlocks = (pageHost && conf.site_specific_blocks[pageHost]) || []; @@ -785,8 +785,8 @@ class PanelData { blocked: selectedAppIds.hasOwnProperty(trackerId), ss_allowed: pageUnblocks.includes(+trackerId), ss_blocked: pageBlocks.includes(+trackerId), - sb_blocked: smartBlockActive && smartBlock.blocked.hasOwnProperty(`${trackerId}`), - sb_allowed: smartBlockActive && smartBlock.unblocked.hasOwnProperty(`${trackerId}`) + sb_blocked: smartBrowseActive && smartBrowse.blocked.hasOwnProperty(`${trackerId}`), + sb_allowed: smartBrowseActive && smartBrowse.unblocked.hasOwnProperty(`${trackerId}`) }; } diff --git a/src/classes/PolicySmartBlock.js b/src/classes/PolicySmartBrowse.js similarity index 88% rename from src/classes/PolicySmartBlock.js rename to src/classes/PolicySmartBrowse.js index 76d1f8538..d56b26f39 100644 --- a/src/classes/PolicySmartBlock.js +++ b/src/classes/PolicySmartBrowse.js @@ -25,7 +25,7 @@ import { log } from '../utils/common'; * @memberOf BackgroundClasses * @todo make it a Singelton */ -class PolicySmartBlock { +class PolicySmartBrowse { constructor() { this.allowedCategoriesList = [ 'essential', @@ -50,23 +50,23 @@ class PolicySmartBlock { * applicable to this url, or none are met. */ shouldUnblock(appId, catId, tabId, pageURL, requestType) { - if (!PolicySmartBlock.shouldCheck(tabId, appId)) { return false; } + if (!PolicySmartBrowse.shouldCheck(tabId, appId)) { return false; } let reason; - if (PolicySmartBlock._appHasKnownIssue(tabId, appId, pageURL)) { + if (PolicySmartBrowse._appHasKnownIssue(tabId, appId, pageURL)) { reason = 'hasIssue'; // allow if tracker is in compatibility list } else if (this._allowedCategories(tabId, appId, catId)) { reason = 'allowedCategory'; // allow if tracker is in breaking category } else if (this._allowedTypes(tabId, appId, requestType)) { reason = 'allowedType'; // allow if tracker is in breaking type - } else if (PolicySmartBlock._pageWasReloaded(tabId, appId)) { + } else if (PolicySmartBrowse._pageWasReloaded(tabId, appId)) { reason = 'pageReloaded'; // allow if page has been reloaded recently } if (reason) { log('Smart Blocking unblocked appId', appId, 'for reason:', reason); - tabInfo.setTabSmartBlockAppInfo(tabId, appId, reason, false); + tabInfo.setTabSmartBrowseAppInfo(tabId, appId, reason, false); return true; } @@ -84,21 +84,21 @@ class PolicySmartBlock { * applicable to this url, or none are met. */ shouldBlock(appId, catId, tabId, pageURL, requestType, requestTimestamp) { - if (!PolicySmartBlock.shouldCheck(tabId, appId)) { return false; } + if (!PolicySmartBrowse.shouldCheck(tabId, appId)) { return false; } let reason; // Block all trackers that load after 5 seconds from when page load started - if (PolicySmartBlock._requestWasSlow(tabId, appId, requestTimestamp)) { + if (PolicySmartBrowse._requestWasSlow(tabId, appId, requestTimestamp)) { reason = 'slow'; - if (PolicySmartBlock._appHasKnownIssue(tabId, appId, pageURL)) { + if (PolicySmartBrowse._appHasKnownIssue(tabId, appId, pageURL)) { reason = 'hasIssue'; // allow if tracker is in compatibility list } else if (this._allowedCategories(tabId, appId, catId)) { reason = 'allowedCategory'; // allow if tracker is in breaking category } else if (this._allowedTypes(tabId, appId, requestType)) { reason = 'allowedType'; // allow if tracker is in breaking type - } else if (PolicySmartBlock._pageWasReloaded(tabId, appId)) { + } else if (PolicySmartBrowse._pageWasReloaded(tabId, appId)) { reason = 'pageReloaded'; // allow if page has been reloaded recently } } @@ -106,7 +106,7 @@ class PolicySmartBlock { const result = (reason === 'slow'); if (result) { log('Smart Blocking blocked appId', appId, 'for reason:', reason); - tabInfo.setTabSmartBlockAppInfo(tabId, appId, 'slow', true); + tabInfo.setTabSmartBrowseAppInfo(tabId, appId, 'slow', true); } return result; @@ -130,7 +130,7 @@ class PolicySmartBlock { const tabHost = tabInfo.getTabInfo(tabId, 'host'); return ( - conf.enable_smart_block && + conf.enable_smart_browse && !globals.SESSION.paused_blocking && !Policy.getSitePolicy(tabUrl) && ((appId && (!conf.site_specific_unblocks.hasOwnProperty(tabHost) || !conf.site_specific_unblocks[tabHost].includes(+appId))) || appId === false) && @@ -147,7 +147,7 @@ class PolicySmartBlock { * @return {boolean} */ static isFirstPartyRequest(tabId, pageDomain = '', requestDomain = '') { - if (!PolicySmartBlock.shouldCheck(tabId)) { return false; } + if (!PolicySmartBrowse.shouldCheck(tabId)) { return false; } return pageDomain === requestDomain; } @@ -181,7 +181,7 @@ class PolicySmartBlock { * @return {boolean} */ static isInsecureRequest(tabId, pageProtocol, requestProtocol, requestHost) { - if (!PolicySmartBlock.shouldCheck(tabId)) { return false; } + if (!PolicySmartBrowse.shouldCheck(tabId)) { return false; } // don't block mixed content from localhost if (requestHost === 'localhost' || requestHost === '127.0.0.1' || requestHost === '[::1]') { @@ -222,13 +222,13 @@ class PolicySmartBlock { * @return {boolean} */ static checkReloadThreshold(tabId) { - if (!PolicySmartBlock.shouldCheck(tabId)) { return false; } + if (!PolicySmartBrowse.shouldCheck(tabId)) { return false; } - const SMART_BLOCK_BEHAVIOR_THRESHOLD = 30000; // 30 seconds + const SMART_BROWSE_BEHAVIOR_THRESHOLD = 30000; // 30 seconds return ( tabInfo.getTabInfoPersist(tabId, 'numOfReloads') > 1 && - (((Date.now() - tabInfo.getTabInfoPersist(tabId, 'firstLoadTimestamp')) < SMART_BLOCK_BEHAVIOR_THRESHOLD) || false) + (((Date.now() - tabInfo.getTabInfoPersist(tabId, 'firstLoadTimestamp')) < SMART_BROWSE_BEHAVIOR_THRESHOLD) || false) ); } @@ -247,4 +247,4 @@ class PolicySmartBlock { } } -export default PolicySmartBlock; +export default PolicySmartBrowse; diff --git a/src/classes/TabInfo.js b/src/classes/TabInfo.js index 24731c7fb..37f291667 100644 --- a/src/classes/TabInfo.js +++ b/src/classes/TabInfo.js @@ -15,7 +15,7 @@ * prefetched: {boolean} indicates that the tab was prefetched and not part of the main window * purplebox: {boolean} indicates that the purplebox.js script has been loaded on this tab * protocol: {string} request protocol - * smartBlock: {Object} smart blocking stats for this tab + * smartBrowse: {Object} smart blocking stats for this tab * url: {string} full url * } * @@ -29,7 +29,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0 */ -import PolicySmartBlock from './PolicySmartBlock'; +import PolicySmartBrowse from './PolicySmartBrowse'; import { processUrl } from '../utils/utils'; /** @@ -58,12 +58,12 @@ class TabInfo { purplebox: false, rewards: false, timestamp: Date.now(), - // assign only when smartBlock is enabled so avoid false positives - // when enabling smartBlock is enabled for the first time - firstLoadTimestamp: PolicySmartBlock.shouldCheck(tab_id) && (numOfReloads === 0 ? Date.now() : ((this.getTabInfoPersist(tab_id, 'firstLoadTimestamp') || 0)) || 0), - reloaded: PolicySmartBlock.checkReloadThreshold(tab_id), + // assign only when smartBrowse is enabled so avoid false positives + // when enabling smartBrowse is enabled for the first time + firstLoadTimestamp: PolicySmartBrowse.shouldCheck(tab_id) && (numOfReloads === 0 ? Date.now() : ((this.getTabInfoPersist(tab_id, 'firstLoadTimestamp') || 0)) || 0), + reloaded: PolicySmartBrowse.checkReloadThreshold(tab_id), numOfReloads, - smartBlock: { + smartBrowse: { blocked: {}, unblocked: {}, }, @@ -125,7 +125,7 @@ class TabInfo { this._tabInfo[tab_id][property] = value; } } - } + } /** * Set Smart Blocking counts for this tab @@ -134,15 +134,15 @@ class TabInfo { * @param {string} rule smart blocking rule name * @param {boolean} blocked kind of policy to set */ - setTabSmartBlockAppInfo(tabId, appId, rule, blocked) { + setTabSmartBrowseAppInfo(tabId, appId, rule, blocked) { if (!this._tabInfo.hasOwnProperty(tabId)) { return; } const policy = blocked ? 'blocked' : 'unblocked'; - if (typeof this._tabInfo[tabId].smartBlock[policy][appId] === 'undefined') { - this._tabInfo[tabId].smartBlock[policy][appId] = []; + if (typeof this._tabInfo[tabId].smartBrowse[policy][appId] === 'undefined') { + this._tabInfo[tabId].smartBrowse[policy][appId] = []; } - if (this._tabInfo[tabId].smartBlock[policy][appId].indexOf(rule) === -1) { - this._tabInfo[tabId].smartBlock[policy][appId].push(rule); + if (this._tabInfo[tabId].smartBrowse[policy][appId].indexOf(rule) === -1) { + this._tabInfo[tabId].smartBrowse[policy][appId].push(rule); } } diff --git a/test/src/PolicySmartBlock.test.js b/test/src/PolicySmartBlock.test.js deleted file mode 100644 index fcaca99b8..000000000 --- a/test/src/PolicySmartBlock.test.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * PolicySmartBlock.js Unit Tests - * - * Ghostery Browser Extension - * http://www.ghostery.com/ - * - * Copyright 2020 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 PolicySmartBlock from '../../src/classes/PolicySmartBlock'; -import { processUrl } from '../../src/utils/utils'; - -let policySmartBlock = new PolicySmartBlock(); - -// Mock imports for dependencies -jest.mock('../../src/classes/TabInfo', () => {}); - -describe('src/classes/PolicySmartBlock.js', () => { - describe('PolicySmartBlock constructor tests', () => { - test('allowedCategoriesList is constructed correctly', () => { - const allowedCategoriesList = [ - 'essential', - 'audio_video_player', - 'comments', - ]; - return expect(policySmartBlock.allowedCategoriesList).toEqual(allowedCategoriesList); - }); - test('allowedTypesList is constructed correctly', () => { - const allowedTypesList = [ - 'stylesheet', - 'image', - 'font', - ]; - return expect(policySmartBlock.allowedTypesList).toEqual(allowedTypesList); - }); - }); - - describe('PolicySmartBlock isFirstPartyRequest tests', () => { - beforeAll(() => { - PolicySmartBlock.shouldCheck = jest.fn(() => true); - }); - - afterAll(() => { - policySmartBlock.mockClear(); - }); - - test('PolicySmartBlock isFirstPartyRequest truthy assertion', () => { - expect(PolicySmartBlock.isFirstPartyRequest('tabId', 'example.com', 'example.com')).toBeTruthy(); - // isFirstPartyRequest() expects pre-parsed domains, so we should parse the test urls - const parsedPage = processUrl('https://checkout.ghostery.com/insights'); - const parsedRequest = processUrl('https://analytics.ghostery.com/piwik.js'); - expect(PolicySmartBlock.isFirstPartyRequest('tabId', parsedPage.generalDomain, parsedRequest.generalDomain)).toBeTruthy(); - }); - - test('PolicySmartBlock isFirstPartyRequest falsy assertion', () => { - expect(PolicySmartBlock.isFirstPartyRequest('tabId', 'www.example.com', 'example.com')).toBeFalsy(); - expect(PolicySmartBlock.isFirstPartyRequest('tabId', 'sub.example.com', 'example.com')).toBeFalsy(); - expect(PolicySmartBlock.isFirstPartyRequest('tabId', 'example.com', 'test.com')).toBeFalsy(); - expect(PolicySmartBlock.isFirstPartyRequest('tabId', 'www.example.com', 'www.test.com')).toBeFalsy(); - }); - }); -}); diff --git a/test/src/PolicySmartBrowse.test.js b/test/src/PolicySmartBrowse.test.js new file mode 100644 index 000000000..347d46ff9 --- /dev/null +++ b/test/src/PolicySmartBrowse.test.js @@ -0,0 +1,66 @@ +/** + * PolicySmartBrowse.js Unit Tests + * + * Ghostery Browser Extension + * http://www.ghostery.com/ + * + * Copyright 2020 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 PolicySmartBrowse from '../../src/classes/PolicySmartBrowse'; +import { processUrl } from '../../src/utils/utils'; + +let policySmartBrowse = new PolicySmartBrowse(); + +// Mock imports for dependencies +jest.mock('../../src/classes/TabInfo', () => {}); + +describe('src/classes/PolicySmartBrowse.js', () => { + describe('PolicySmartBrowse constructor tests', () => { + test('allowedCategoriesList is constructed correctly', () => { + const allowedCategoriesList = [ + 'essential', + 'audio_video_player', + 'comments', + ]; + return expect(policySmartBrowse.allowedCategoriesList).toEqual(allowedCategoriesList); + }); + test('allowedTypesList is constructed correctly', () => { + const allowedTypesList = [ + 'stylesheet', + 'image', + 'font', + ]; + return expect(policySmartBrowse.allowedTypesList).toEqual(allowedTypesList); + }); + }); + + describe('PolicySmartBrowse isFirstPartyRequest tests', () => { + beforeAll(() => { + PolicySmartBrowse.shouldCheck = jest.fn(() => true); + }); + + afterAll(() => { + policySmartBrowse.mockClear(); + }); + + test('PolicySmartBrowse isFirstPartyRequest truthy assertion', () => { + expect(PolicySmartBrowse.isFirstPartyRequest('tabId', 'example.com', 'example.com')).toBeTruthy(); + // isFirstPartyRequest() expects pre-parsed domains, so we should parse the test urls + const parsedPage = processUrl('https://checkout.ghostery.com/insights'); + const parsedRequest = processUrl('https://analytics.ghostery.com/piwik.js'); + expect(PolicySmartBrowse.isFirstPartyRequest('tabId', parsedPage.generalDomain, parsedRequest.generalDomain)).toBeTruthy(); + }); + + test('PolicySmartBrowse isFirstPartyRequest falsy assertion', () => { + expect(PolicySmartBrowse.isFirstPartyRequest('tabId', 'www.example.com', 'example.com')).toBeFalsy(); + expect(PolicySmartBrowse.isFirstPartyRequest('tabId', 'sub.example.com', 'example.com')).toBeFalsy(); + expect(PolicySmartBrowse.isFirstPartyRequest('tabId', 'example.com', 'test.com')).toBeFalsy(); + expect(PolicySmartBrowse.isFirstPartyRequest('tabId', 'www.example.com', 'www.test.com')).toBeFalsy(); + }); + }); +}); From c276bf69c129b39233b0abfebea9b18e9cd92bd2 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 6 Oct 2020 17:41:38 -0400 Subject: [PATCH 06/11] Update snapshot --- .../content/__tests__/__snapshots__/OverviewTab.jsx.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap b/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap index b6fc57b6e..fe71a256d 100644 --- a/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap +++ b/app/panel-android/components/content/__tests__/__snapshots__/OverviewTab.jsx.snap @@ -334,7 +334,7 @@ exports[`app/panel-android/components/content/OverviewTab.jsx Snapshot tests wit > trackers_blocked - + requests_modified - + Date: Tue, 27 Oct 2020 12:31:11 -0400 Subject: [PATCH 07/11] Update copy --- _locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 08ea5ec79..427b05443 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -810,7 +810,7 @@ "message": "Ad-Block Lists" }, "settings_adblocker_lists": { - "message": "Load the following Ad-Block filter lists:" + "message": "Load the following ad-block filter lists:" }, "settings_adblocker_list_1": { "message": "Ads only" From 4afc08d8e9c99a147f93836a1be180962d073023 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 27 Oct 2020 12:34:59 -0400 Subject: [PATCH 08/11] Smart Browsing -> Smart-Browsing, add a dash --- _locales/en/messages.json | 10 +++++----- .../SetupAntiSuiteView/SetupAntiSuiteView.scss | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 427b05443..e9b14b92f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -675,10 +675,10 @@ "message": "Tracker is slow" }, "panel_tracker_warning_smartbrowse_tooltip": { - "message": "Tracker blocked by Smart Browsing" + "message": "Tracker blocked by Smart-Browsing" }, "panel_tracker_warning_smartunblock_tooltip": { - "message": "Tracker unblocked by Smart Browsing" + "message": "Tracker unblocked by Smart-Browsing" }, "panel_tracker_block_tooltip": { "message": "Block on all sites" @@ -1146,10 +1146,10 @@ "message": "Ad-Blocking OFF. Advertisements will not be blocked." }, "alert_smart_browse_on": { - "message": "Smart Browsing ON. Tracker blocking will be adjusted to optimize page performance." + "message": "Smart-Browsing ON. Tracker blocking will be adjusted to optimize page performance." }, "alert_smart_browse_off": { - "message": "Smart Browsing OFF. Tracker blocking will not be automatically adjusted." + "message": "Smart-Browsing OFF. Tracker blocking will not be automatically adjusted." }, "alert_reload": { "message": "Reload to see changes." @@ -2465,7 +2465,7 @@ "message": "Ad-Blocking" }, "smart_browsing": { - "message": "Smart Browsing" + "message": "Smart-Browsing" }, "smart_browsing_DESC": { "message": "Automatically block and unblock trackers to optimize page performance." diff --git a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss index 4f3570f49..69a145777 100644 --- a/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss +++ b/app/hub/Views/SetupViews/SetupAntiSuiteView/SetupAntiSuiteView.scss @@ -63,7 +63,7 @@ background-image: buildAdBlockActiveIcon(#1dafed); } -// Smart Browsing Icon +// Smart-Browsing Icon .SetupAntiSuite__feature .smart-browsing { background-image: buildSmartBrowsingIcon(#9f9f9f); } From 3bf1cc168eaab7dec7ca36b0805272ff9215f6bb Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 27 Oct 2020 13:33:39 -0400 Subject: [PATCH 09/11] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc1013fc7..0313066b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -134,7 +134,7 @@ See the complete GitHub [milestone](https://github.com/ghostery/ghostery-extensi + Add new counter for Requests Modified by Anti-Tracking (#392) + Show fingerprint, cookie and advertisement icons in Detail View tracker list (#394) + Improved Anti-Tracking integration (#377) -+ Integrate Click2Play into SmartBrowsing (#388) ++ Integrate Click2Play into SmartBlocking (#388) + Respect pause state before displaying CMP and Rewards windows (Fixes #389) + Performance improvements (Fixes #12) + Improved Ad-Blocker filter rule injection (Fixes #381) From b0d54a85905f1c02186a016f6a1e0dba3950b5c2 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 27 Oct 2020 13:34:28 -0400 Subject: [PATCH 10/11] Update more variables (smartBrowseBlocked/smartBrowseUnblocked) --- src/classes/EventHandlers.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/classes/EventHandlers.js b/src/classes/EventHandlers.js index d5a5d4554..d28d024d3 100644 --- a/src/classes/EventHandlers.js +++ b/src/classes/EventHandlers.js @@ -418,8 +418,8 @@ class EventHandlers { }; } - const smartBrowseed = !block ? this.policySmartBrowse.shouldBlock(app_id, cat_id, tab_id, page_url, eventMutable.type, eventMutable.timeStamp) : false; - const smartUnblocked = block ? this.policySmartBrowse.shouldUnblock(app_id, cat_id, tab_id, page_url, eventMutable.type) : false; + const smartBrowseBlocked = !block ? this.policySmartBrowse.shouldBlock(app_id, cat_id, tab_id, page_url, eventMutable.type, eventMutable.timeStamp) : false; + const smartBrowseUnblocked = block ? this.policySmartBrowse.shouldUnblock(app_id, cat_id, tab_id, page_url, eventMutable.type) : false; // process the tracker asynchronously // very important to block request processing as little as necessary @@ -430,14 +430,14 @@ class EventHandlers { type: eventMutable.type, url: eventMutable.url, block, - smartBrowseed, + smartBrowseBlocked, tab_id, from_frame: eventMutable.parentFrameId !== -1, request_id }); }, 1); - if ((block && !smartUnblocked) || smartBrowseed) { + if ((block && !smartBrowseUnblocked) || smartBrowseBlocked) { return EventHandlers._blockHelper(eventMutable, tab_id, app_id, bug_id, request_id, fromRedirect); } @@ -592,14 +592,14 @@ class EventHandlers { */ _processBug(details) { const { - bug_id, app_id, type, url, block, smartBrowseed, tab_id, request_id + bug_id, app_id, type, url, block, smartBrowseBlocked, tab_id, request_id } = details; const tab = tabInfo.getTabInfo(tab_id); const allowedOnce = c2pDb.allowedOnce(details.tab_id, app_id); let num_apps_old; - log((block || smartBrowseed ? 'Blocked' : 'Found'), type, url); + log((block || smartBrowseBlocked ? 'Blocked' : 'Found'), type, url); log(`^^^ Pattern ID ${bug_id} on tab ID ${tab_id}`); if (conf.show_alert) { @@ -613,7 +613,7 @@ class EventHandlers { // throttled in PanelData panelData.updatePanelUI(); - if ((block || smartBrowseed) && (conf.enable_click2play || conf.enable_click2playSocial) && !allowedOnce) { + if ((block || smartBrowseBlocked) && (conf.enable_click2play || conf.enable_click2playSocial) && !allowedOnce) { buildC2P(details, app_id); } From 0166d29c75dcf4e3c430e07965dd80a38b9f1d04 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 27 Oct 2020 13:37:28 -0400 Subject: [PATCH 11/11] Update Smart Blocking -> Smart Blocking in comments --- app/panel/utils/blocking.js | 2 +- src/classes/PanelData.js | 2 +- src/classes/PolicySmartBrowse.js | 14 +++++++------- src/classes/TabInfo.js | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/panel/utils/blocking.js b/app/panel/utils/blocking.js index af440c723..aeb0a0de7 100644 --- a/app/panel/utils/blocking.js +++ b/app/panel/utils/blocking.js @@ -19,7 +19,7 @@ import { sendMessage } from './msg'; * Dispatch action to SummaryActions to update trackerCounts. * @memberOf PanelUtils * @param {array} categories array of categories - * @param {object} smartBrowse blocked and unblocked of Smart Blocking + * @param {object} smartBrowse blocked and unblocked of Smart-Browsing * @param {function} updateTrackerCounts from SummaryActions */ export function updateSummaryBlockingCount(categories = [], smartBrowse, updateTrackerCounts) { diff --git a/src/classes/PanelData.js b/src/classes/PanelData.js index ad215dbba..c24eaa0aa 100644 --- a/src/classes/PanelData.js +++ b/src/classes/PanelData.js @@ -726,7 +726,7 @@ class PanelData { * @private * @param {Object} tracker * @param {Object} trackerState - * @param {Object} smartBrowse smart blocking stats for the active tab + * @param {Object} smartBrowse smart-browsing stats for the active tab * @return {Object} object of tracker data */ static _buildTracker(tracker, trackerState, smartBrowse) { diff --git a/src/classes/PolicySmartBrowse.js b/src/classes/PolicySmartBrowse.js index d56b26f39..eafd76d75 100644 --- a/src/classes/PolicySmartBrowse.js +++ b/src/classes/PolicySmartBrowse.js @@ -1,7 +1,7 @@ /** - * Smart Blocking Policy Class + * Smart-Browsing Policy Class * - * Handles policy for Smart Blocking + * Handles policy for Smart-Browsing * * Ghostery Browser Extension * https://www.ghostery.com/ @@ -21,7 +21,7 @@ import Policy from './Policy'; import c2pDb from './Click2PlayDb'; import { log } from '../utils/common'; /** - * Class for handling Smart Blocking site policy. + * Class for handling Smart-Browsing site policy. * @memberOf BackgroundClasses * @todo make it a Singelton */ @@ -65,7 +65,7 @@ class PolicySmartBrowse { } if (reason) { - log('Smart Blocking unblocked appId', appId, 'for reason:', reason); + log('Smart-Browsing unblocked appId', appId, 'for reason:', reason); tabInfo.setTabSmartBrowseAppInfo(tabId, appId, reason, false); return true; } @@ -105,7 +105,7 @@ class PolicySmartBrowse { const result = (reason === 'slow'); if (result) { - log('Smart Blocking blocked appId', appId, 'for reason:', reason); + log('Smart-Browsing blocked appId', appId, 'for reason:', reason); tabInfo.setTabSmartBrowseAppInfo(tabId, appId, 'slow', true); } @@ -113,8 +113,8 @@ class PolicySmartBrowse { } /** - * Check if Smart Block should proceed based on: - * 1. Smart Block is enabled + * Check if Smart-Browse should proceed based on: + * 1. Smart-Browse is enabled * 2. Paused blocking is disabled * 3. Page is neither whitelisted or blacklisted * 4. Tracker is not site-specific unblocked diff --git a/src/classes/TabInfo.js b/src/classes/TabInfo.js index 37f291667..948349f38 100644 --- a/src/classes/TabInfo.js +++ b/src/classes/TabInfo.js @@ -15,7 +15,7 @@ * prefetched: {boolean} indicates that the tab was prefetched and not part of the main window * purplebox: {boolean} indicates that the purplebox.js script has been loaded on this tab * protocol: {string} request protocol - * smartBrowse: {Object} smart blocking stats for this tab + * smartBrowse: {Object} smart-browsing stats for this tab * url: {string} full url * } * @@ -128,10 +128,10 @@ class TabInfo { } /** - * Set Smart Blocking counts for this tab + * Set Smart-Browsing counts for this tab * @param {number} tabId tab id * @param {number} appId tracker id - * @param {string} rule smart blocking rule name + * @param {string} rule smart-browsing rule name * @param {boolean} blocked kind of policy to set */ setTabSmartBrowseAppInfo(tabId, appId, rule, blocked) {