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

Fix for Edge Setup trouble (GH-1261) #134

Merged
merged 3 commits into from Jul 12, 2018
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -651,20 +651,12 @@ function onMessageHandler(request, sender, callback) {
break;
}
} else if (name === 'skipSetup') {
// kill setup window and link to blog post
chrome.tabs.remove(tab_id);
utils.openNewTab({
url: 'https://www.ghostery.com/blog/product-releases/browse-smarter-with-ghostery-8/',
become_active: true,
});
// link to blog post
chrome.tabs.update(tab_id, { url: 'https://www.ghostery.com/blog/product-releases/browse-smarter-with-ghostery-8/' });
return false;
} else if (name === 'closeSetup') {
// kill setup window and link to blog post
chrome.tabs.remove(tab_id);
utils.openNewTab({
url: 'https://www.ghostery.com/blog/product-releases/browse-smarter-with-ghostery-8/',
become_active: true,
});
// link to blog post
chrome.tabs.update(tab_id, { url: 'https://www.ghostery.com/blog/product-releases/browse-smarter-with-ghostery-8/' });
return false;
} else if (name === 'getPanelData') {
if (!message.tabId) {
@@ -1442,40 +1434,53 @@ function initializeGhosteryModules() {
metrics.ping('install_complete');
}
// start cliqz app
const cliqzStartup = cliqz.start().then(() =>
const cliqzStartup = cliqz.start().then(() => {
// run wrapper tasks which set up base integrations between ghostery and these modules
Promise.all([
initialiseWebRequestPipeline(),
]).then(() => {
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;
// Enable Offers except on Edge or Cliqz
conf.enable_offers = !((IS_EDGE || IS_CLIQZ));
} 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 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;
conf.enable_offers = (IS_EDGE || IS_CLIQZ) ? false : !offers.isDisabled;
if (!(IS_EDGE || IS_CLIQZ)) {
if (globals.JUST_UPGRADED_FROM_7) {
// These users had human web already, so we respect their choice
conf.enable_human_web = !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;
// Enable Offers except on Edge or Cliqz
conf.enable_offers = true;
} 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 = !adblocker.isDisabled;
conf.enable_anti_tracking = !antitracking.isDisabled;
conf.enable_human_web = !humanweb.isDisabled;
// These users did not have Offers, so we enable them on upgrade.
conf.enable_offers = true;
} else {
// Otherwise we respect browser-core default settings
conf.enable_ad_block = !adblocker.isDisabled;
conf.enable_anti_tracking = !antitracking.isDisabled;
conf.enable_human_web = !humanweb.isDisabled;
conf.enable_offers = !offers.isDisabled;
}
}
})).catch((e) => {
});
}).catch((e) => {
log('cliqzStartup error', e);
});

if (IS_EDGE) {
setCliqzModuleEnabled(hpn, false);
setCliqzModuleEnabled(humanweb, false);
setCliqzModuleEnabled(offers, false);
}

if (IS_CLIQZ) {
setCliqzModuleEnabled(hpn, false);
setCliqzModuleEnabled(humanweb, false);
setCliqzModuleEnabled(antitracking, false);
setCliqzModuleEnabled(adblocker, false);
setCliqzModuleEnabled(offers, false);
}

// Set these tasks to run every hour
@@ -1493,16 +1498,6 @@ function initializeGhosteryModules() {
}
}

cliqzStartup.then(() => {
if (!IS_EDGE && !IS_CLIQZ) {
abtest.fetch().then(() => {
setupABTest();
}).catch((err) => {
log('cliqzStartup abtest fetch error', err);
});
}
});

// Check CMP right away.
cmp.fetchCMPData();
// Check CMP and ABTest every hour.
@@ -1566,3 +1561,4 @@ function init() {

// Initialize the application.
init();

ProTip! Use n and p to navigate between commits in a pull request.