diff --git a/src/background.js b/src/background.js index f17467dfd..4df749520 100644 --- a/src/background.js +++ b/src/background.js @@ -1118,7 +1118,12 @@ function getAntitrackingTestConfig() { * @return {Object} Hub promotion configuration parameters */ function setupHubPromoABTest() { - if (conf.hub_promo_variant !== 'not_yet_set') return; + if ( + !abtest.hasBeenFetched + || conf.hub_promo_variant !== 'not_yet_set' + ) { + return; + } if (abtest.hasTest('hub_plain')) { conf.hub_promo_variant = 'plain'; diff --git a/src/classes/ABTest.js b/src/classes/ABTest.js index df7a235fb..1236310ce 100644 --- a/src/classes/ABTest.js +++ b/src/classes/ABTest.js @@ -27,6 +27,7 @@ const { BROWSER_INFO, CMP_BASE_URL, EXTENSION_VERSION } = globals; class ABTest { constructor() { this.tests = {}; + this.hasBeenFetched = false; } /** @@ -63,6 +64,7 @@ class ABTest { (tests, test) => Object.assign(tests, { [test.name]: test.data }), {} ); + this.hasBeenFetched = true; } else { log('A/B Tests: no tests found.'); }