Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respecting user choice on Offers plus removing Edge-specific key from manifest plus fixing vertical blank (GH-1244, GH-1199, GH-1236) #119

Merged
merged 2 commits into from Jul 5, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next
Fix for respecting user choice plus removing manifest Edge-specific key.
  • Loading branch information
zarembsky committed Jul 3, 2018
commit 6a4b9653415639e40f0062d30fc7e853039008ba
@@ -12,6 +12,7 @@
"version_name": "8.2.0",
"default_locale": "en",
"description": "__MSG_short_description__",
"debug": true,
"icons": {
"16": "app/images/icon16.png",
"48": "app/images/icon48.png",
@@ -93,10 +94,5 @@
"web_accessible_resources": [
"app/images/*",
"dist/css/rewards_styles.css"
],
"browser_specific_settings": {
"edge": {
"browser_action_next_to_addressbar": true
}
}
]
}
@@ -1361,6 +1361,11 @@ function initializeVersioning() {
conf.enable_smart_block = false;
}

// Are we upgrading from Ghostery 8 prior to 8.2?
if ((+prevVersion[0] === 8) && (prevVersion[1] < 2)) {
globals.JUST_UPGRADED_FROM_8_1 = true;
}

// Establish version history
const { version_history } = conf;
version_history.push(globals.EXTENSION_VERSION);
@@ -1429,18 +1434,28 @@ function initializeGhosteryModules() {
Promise.all([
initialiseWebRequestPipeline(),
]).then(() => {
// Upgraded users shouldn't get the anti-suite
if (globals.JUST_UPGRADED_FROM_7) {
// These users had human web already, so we respect their choice
conf.enable_human_web = (IS_EDGE || IS_CLIQZ) ? false : !humanweb.isDisabled;
// These users did not have adblocking and antitracking.
// We introduce these new features initially disabled.
conf.enable_ad_block = false;
conf.enable_anti_tracking = false;
// Offers however will be enabled unconditionally
conf.enable_offers = !((IS_EDGE || IS_CLIQZ));
conf.enable_human_web = (IS_EDGE || IS_CLIQZ) ? false : conf.enable_human_web;
} else if (globals.JUST_UPGRADED_FROM_8_1) {
// These users already had human web, adblocker and antitracking, so we respect their choice
conf.enable_ad_block = IS_CLIQZ ? false : !adblocker.isDisabled;
conf.enable_anti_tracking = IS_CLIQZ ? false : !antitracking.isDisabled;
conf.enable_human_web = (IS_EDGE || IS_CLIQZ) ? false : !humanweb.isDisabled;
// These users did not have Offers, so we unconditionally enable them on upgrade.
conf.enable_offers = !(IS_EDGE || IS_CLIQZ);
} else {
// Otherwise we respect browser-core default settings
conf.enable_ad_block = IS_CLIQZ ? false : !adblocker.isDisabled;
conf.enable_anti_tracking = IS_CLIQZ ? false : !antitracking.isDisabled;
conf.enable_human_web = (IS_EDGE || IS_CLIQZ) ? false : !humanweb.isDisabled;
// This code forces enable_offers to true on upgrade. Remove in the next version of Ghostery!
conf.enable_offers = (IS_EDGE || IS_CLIQZ) ? false : globals.JUST_UPGRADED ? true : !offers.isDisabled;
conf.enable_offers = (IS_EDGE || IS_CLIQZ) ? false : !offers.isDisabled;
}
})).catch((e) => {
log('cliqzStartup error', e);
@@ -92,10 +92,6 @@ class ConfData {
_initProperty('trackers_banner_status', true);
}

// Disregard original offers value, so that default value is assigned.
// REMOVE THIS IS THE NEXT VERSION
delete data.enable_offers;

// simple props
_initProperty('alert_bubble_pos', 'br');
_initProperty('alert_bubble_timeout', 15);
@@ -37,6 +37,7 @@ class Globals {
this.JUST_INSTALLED = false;
this.JUST_UPGRADED = false;
this.JUST_UPGRADED_FROM_7 = false;
this.JUST_UPGRADED_FROM_8_1 = false;
this.HOTFIX = false;
this.LET_REDIRECTS_THROUGH = false;
this.C2P_LOADED = false;
ProTip! Use n and p to navigate between commits in a pull request.