Skip to content

Commit f4b2f62

Browse files
Release build 8.22.0 [ci release]
1 parent c5dc2cf commit f4b2f62

File tree

22 files changed

+618
-38
lines changed

22 files changed

+618
-38
lines changed

CHANGELOG.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
- windows: enabled message bridge (#1663)
1+
- Conditional experiment matching (#1661)
2+
- Move ad blocking setting row to the last position (#1687)

Sources/ContentScopeScripts/dist/contentScope.js

+42-2
Original file line numberDiff line numberDiff line change
@@ -3639,7 +3639,18 @@
36393639
__privateAdd(this, _bundledConfig);
36403640
/** @type {string} */
36413641
__publicField(this, "name");
3642-
/** @type {{ debug?: boolean, desktopModeEnabled?: boolean, forcedZoomEnabled?: boolean, featureSettings?: Record<string, unknown>, assets?: import('./content-feature.js').AssetConfig | undefined, site: import('./content-feature.js').Site, messagingConfig?: import('@duckduckgo/messaging').MessagingConfig } | null} */
3642+
/**
3643+
* @type {{
3644+
* debug?: boolean,
3645+
* desktopModeEnabled?: boolean,
3646+
* forcedZoomEnabled?: boolean,
3647+
* featureSettings?: Record<string, unknown>,
3648+
* assets?: import('./content-feature.js').AssetConfig | undefined,
3649+
* site: import('./content-feature.js').Site,
3650+
* messagingConfig?: import('@duckduckgo/messaging').MessagingConfig,
3651+
* currentCohorts?: [{feature: string, cohort: string, subfeature: string}],
3652+
* } | null}
3653+
*/
36433654
__privateAdd(this, _args);
36443655
this.name = name;
36453656
const { bundledConfig, site, platform } = args;
@@ -3702,6 +3713,9 @@
37023713
* @typedef {object} ConditionBlock
37033714
* @property {string[] | string} [domain]
37043715
* @property {object} [urlPattern]
3716+
* @property {object} [experiment]
3717+
* @property {string} [experiment.experimentName]
3718+
* @property {string} [experiment.cohort]
37053719
*/
37063720
/**
37073721
* Takes multiple conditional blocks and returns true if any apply.
@@ -3723,7 +3737,8 @@
37233737
_matchConditionalBlock(conditionBlock) {
37243738
const conditionChecks = {
37253739
domain: this._matchDomainConditional,
3726-
urlPattern: this._matchUrlPatternConditional
3740+
urlPattern: this._matchUrlPatternConditional,
3741+
experiment: this._matchExperimentConditional
37273742
};
37283743
for (const key in conditionBlock) {
37293744
if (!conditionChecks[key]) {
@@ -3734,6 +3749,31 @@
37343749
}
37353750
return true;
37363751
}
3752+
/**
3753+
* Takes a condition block and returns true if the current experiment matches the experimentName and cohort.
3754+
* Expects:
3755+
* ```json
3756+
* {
3757+
* "experiment": {
3758+
* "experimentName": "experimentName",
3759+
* "cohort": "cohort-name"
3760+
* }
3761+
* }
3762+
* ```
3763+
* Where featureName "ContentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
3764+
* @param {ConditionBlock} conditionBlock
3765+
* @returns {boolean}
3766+
*/
3767+
_matchExperimentConditional(conditionBlock) {
3768+
if (!conditionBlock.experiment) return false;
3769+
const experiment = conditionBlock.experiment;
3770+
if (!experiment.experimentName || !experiment.cohort) return false;
3771+
const currentCohorts = this.args?.currentCohorts;
3772+
if (!currentCohorts) return false;
3773+
return currentCohorts.some((cohort) => {
3774+
return cohort.feature === "ContentScopeExperiments" && cohort.subfeature === experiment.experimentName && cohort.cohort === experiment.cohort;
3775+
});
3776+
}
37373777
/**
37383778
* Takes a condtion block and returns true if the current url matches the urlPattern.
37393779
* @param {ConditionBlock} conditionBlock

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

+42-2
Original file line numberDiff line numberDiff line change
@@ -4344,7 +4344,18 @@
43444344
__privateAdd(this, _bundledConfig);
43454345
/** @type {string} */
43464346
__publicField(this, "name");
4347-
/** @type {{ debug?: boolean, desktopModeEnabled?: boolean, forcedZoomEnabled?: boolean, featureSettings?: Record<string, unknown>, assets?: import('./content-feature.js').AssetConfig | undefined, site: import('./content-feature.js').Site, messagingConfig?: import('@duckduckgo/messaging').MessagingConfig } | null} */
4347+
/**
4348+
* @type {{
4349+
* debug?: boolean,
4350+
* desktopModeEnabled?: boolean,
4351+
* forcedZoomEnabled?: boolean,
4352+
* featureSettings?: Record<string, unknown>,
4353+
* assets?: import('./content-feature.js').AssetConfig | undefined,
4354+
* site: import('./content-feature.js').Site,
4355+
* messagingConfig?: import('@duckduckgo/messaging').MessagingConfig,
4356+
* currentCohorts?: [{feature: string, cohort: string, subfeature: string}],
4357+
* } | null}
4358+
*/
43484359
__privateAdd(this, _args);
43494360
this.name = name;
43504361
const { bundledConfig, site, platform } = args;
@@ -4407,6 +4418,9 @@
44074418
* @typedef {object} ConditionBlock
44084419
* @property {string[] | string} [domain]
44094420
* @property {object} [urlPattern]
4421+
* @property {object} [experiment]
4422+
* @property {string} [experiment.experimentName]
4423+
* @property {string} [experiment.cohort]
44104424
*/
44114425
/**
44124426
* Takes multiple conditional blocks and returns true if any apply.
@@ -4428,7 +4442,8 @@
44284442
_matchConditionalBlock(conditionBlock) {
44294443
const conditionChecks = {
44304444
domain: this._matchDomainConditional,
4431-
urlPattern: this._matchUrlPatternConditional
4445+
urlPattern: this._matchUrlPatternConditional,
4446+
experiment: this._matchExperimentConditional
44324447
};
44334448
for (const key in conditionBlock) {
44344449
if (!conditionChecks[key]) {
@@ -4439,6 +4454,31 @@
44394454
}
44404455
return true;
44414456
}
4457+
/**
4458+
* Takes a condition block and returns true if the current experiment matches the experimentName and cohort.
4459+
* Expects:
4460+
* ```json
4461+
* {
4462+
* "experiment": {
4463+
* "experimentName": "experimentName",
4464+
* "cohort": "cohort-name"
4465+
* }
4466+
* }
4467+
* ```
4468+
* Where featureName "ContentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
4469+
* @param {ConditionBlock} conditionBlock
4470+
* @returns {boolean}
4471+
*/
4472+
_matchExperimentConditional(conditionBlock) {
4473+
if (!conditionBlock.experiment) return false;
4474+
const experiment = conditionBlock.experiment;
4475+
if (!experiment.experimentName || !experiment.cohort) return false;
4476+
const currentCohorts = this.args?.currentCohorts;
4477+
if (!currentCohorts) return false;
4478+
return currentCohorts.some((cohort) => {
4479+
return cohort.feature === "ContentScopeExperiments" && cohort.subfeature === experiment.experimentName && cohort.cohort === experiment.cohort;
4480+
});
4481+
}
44424482
/**
44434483
* Takes a condtion block and returns true if the current url matches the urlPattern.
44444484
* @param {ConditionBlock} conditionBlock

Sources/ContentScopeScripts/dist/pages/onboarding/dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/android/autofillPasswordImport.js

+42-2
Original file line numberDiff line numberDiff line change
@@ -2767,7 +2767,18 @@
27672767
__privateAdd(this, _bundledConfig);
27682768
/** @type {string} */
27692769
__publicField(this, "name");
2770-
/** @type {{ debug?: boolean, desktopModeEnabled?: boolean, forcedZoomEnabled?: boolean, featureSettings?: Record<string, unknown>, assets?: import('./content-feature.js').AssetConfig | undefined, site: import('./content-feature.js').Site, messagingConfig?: import('@duckduckgo/messaging').MessagingConfig } | null} */
2770+
/**
2771+
* @type {{
2772+
* debug?: boolean,
2773+
* desktopModeEnabled?: boolean,
2774+
* forcedZoomEnabled?: boolean,
2775+
* featureSettings?: Record<string, unknown>,
2776+
* assets?: import('./content-feature.js').AssetConfig | undefined,
2777+
* site: import('./content-feature.js').Site,
2778+
* messagingConfig?: import('@duckduckgo/messaging').MessagingConfig,
2779+
* currentCohorts?: [{feature: string, cohort: string, subfeature: string}],
2780+
* } | null}
2781+
*/
27712782
__privateAdd(this, _args);
27722783
this.name = name;
27732784
const { bundledConfig, site, platform } = args;
@@ -2830,6 +2841,9 @@
28302841
* @typedef {object} ConditionBlock
28312842
* @property {string[] | string} [domain]
28322843
* @property {object} [urlPattern]
2844+
* @property {object} [experiment]
2845+
* @property {string} [experiment.experimentName]
2846+
* @property {string} [experiment.cohort]
28332847
*/
28342848
/**
28352849
* Takes multiple conditional blocks and returns true if any apply.
@@ -2851,7 +2865,8 @@
28512865
_matchConditionalBlock(conditionBlock) {
28522866
const conditionChecks = {
28532867
domain: this._matchDomainConditional,
2854-
urlPattern: this._matchUrlPatternConditional
2868+
urlPattern: this._matchUrlPatternConditional,
2869+
experiment: this._matchExperimentConditional
28552870
};
28562871
for (const key in conditionBlock) {
28572872
if (!conditionChecks[key]) {
@@ -2862,6 +2877,31 @@
28622877
}
28632878
return true;
28642879
}
2880+
/**
2881+
* Takes a condition block and returns true if the current experiment matches the experimentName and cohort.
2882+
* Expects:
2883+
* ```json
2884+
* {
2885+
* "experiment": {
2886+
* "experimentName": "experimentName",
2887+
* "cohort": "cohort-name"
2888+
* }
2889+
* }
2890+
* ```
2891+
* Where featureName "ContentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
2892+
* @param {ConditionBlock} conditionBlock
2893+
* @returns {boolean}
2894+
*/
2895+
_matchExperimentConditional(conditionBlock) {
2896+
if (!conditionBlock.experiment) return false;
2897+
const experiment = conditionBlock.experiment;
2898+
if (!experiment.experimentName || !experiment.cohort) return false;
2899+
const currentCohorts = this.args?.currentCohorts;
2900+
if (!currentCohorts) return false;
2901+
return currentCohorts.some((cohort) => {
2902+
return cohort.feature === "ContentScopeExperiments" && cohort.subfeature === experiment.experimentName && cohort.cohort === experiment.cohort;
2903+
});
2904+
}
28652905
/**
28662906
* Takes a condtion block and returns true if the current url matches the urlPattern.
28672907
* @param {ConditionBlock} conditionBlock

build/android/brokerProtection.js

+42-2
Original file line numberDiff line numberDiff line change
@@ -4310,7 +4310,18 @@
43104310
__privateAdd(this, _bundledConfig);
43114311
/** @type {string} */
43124312
__publicField(this, "name");
4313-
/** @type {{ debug?: boolean, desktopModeEnabled?: boolean, forcedZoomEnabled?: boolean, featureSettings?: Record<string, unknown>, assets?: import('./content-feature.js').AssetConfig | undefined, site: import('./content-feature.js').Site, messagingConfig?: import('@duckduckgo/messaging').MessagingConfig } | null} */
4313+
/**
4314+
* @type {{
4315+
* debug?: boolean,
4316+
* desktopModeEnabled?: boolean,
4317+
* forcedZoomEnabled?: boolean,
4318+
* featureSettings?: Record<string, unknown>,
4319+
* assets?: import('./content-feature.js').AssetConfig | undefined,
4320+
* site: import('./content-feature.js').Site,
4321+
* messagingConfig?: import('@duckduckgo/messaging').MessagingConfig,
4322+
* currentCohorts?: [{feature: string, cohort: string, subfeature: string}],
4323+
* } | null}
4324+
*/
43144325
__privateAdd(this, _args);
43154326
this.name = name;
43164327
const { bundledConfig, site, platform } = args;
@@ -4373,6 +4384,9 @@
43734384
* @typedef {object} ConditionBlock
43744385
* @property {string[] | string} [domain]
43754386
* @property {object} [urlPattern]
4387+
* @property {object} [experiment]
4388+
* @property {string} [experiment.experimentName]
4389+
* @property {string} [experiment.cohort]
43764390
*/
43774391
/**
43784392
* Takes multiple conditional blocks and returns true if any apply.
@@ -4394,7 +4408,8 @@
43944408
_matchConditionalBlock(conditionBlock) {
43954409
const conditionChecks = {
43964410
domain: this._matchDomainConditional,
4397-
urlPattern: this._matchUrlPatternConditional
4411+
urlPattern: this._matchUrlPatternConditional,
4412+
experiment: this._matchExperimentConditional
43984413
};
43994414
for (const key in conditionBlock) {
44004415
if (!conditionChecks[key]) {
@@ -4405,6 +4420,31 @@
44054420
}
44064421
return true;
44074422
}
4423+
/**
4424+
* Takes a condition block and returns true if the current experiment matches the experimentName and cohort.
4425+
* Expects:
4426+
* ```json
4427+
* {
4428+
* "experiment": {
4429+
* "experimentName": "experimentName",
4430+
* "cohort": "cohort-name"
4431+
* }
4432+
* }
4433+
* ```
4434+
* Where featureName "ContentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
4435+
* @param {ConditionBlock} conditionBlock
4436+
* @returns {boolean}
4437+
*/
4438+
_matchExperimentConditional(conditionBlock) {
4439+
if (!conditionBlock.experiment) return false;
4440+
const experiment = conditionBlock.experiment;
4441+
if (!experiment.experimentName || !experiment.cohort) return false;
4442+
const currentCohorts = this.args?.currentCohorts;
4443+
if (!currentCohorts) return false;
4444+
return currentCohorts.some((cohort) => {
4445+
return cohort.feature === "ContentScopeExperiments" && cohort.subfeature === experiment.experimentName && cohort.cohort === experiment.cohort;
4446+
});
4447+
}
44084448
/**
44094449
* Takes a condtion block and returns true if the current url matches the urlPattern.
44104450
* @param {ConditionBlock} conditionBlock

build/android/contentScope.js

+42-2
Original file line numberDiff line numberDiff line change
@@ -4150,7 +4150,18 @@
41504150
__privateAdd(this, _bundledConfig);
41514151
/** @type {string} */
41524152
__publicField(this, "name");
4153-
/** @type {{ debug?: boolean, desktopModeEnabled?: boolean, forcedZoomEnabled?: boolean, featureSettings?: Record<string, unknown>, assets?: import('./content-feature.js').AssetConfig | undefined, site: import('./content-feature.js').Site, messagingConfig?: import('@duckduckgo/messaging').MessagingConfig } | null} */
4153+
/**
4154+
* @type {{
4155+
* debug?: boolean,
4156+
* desktopModeEnabled?: boolean,
4157+
* forcedZoomEnabled?: boolean,
4158+
* featureSettings?: Record<string, unknown>,
4159+
* assets?: import('./content-feature.js').AssetConfig | undefined,
4160+
* site: import('./content-feature.js').Site,
4161+
* messagingConfig?: import('@duckduckgo/messaging').MessagingConfig,
4162+
* currentCohorts?: [{feature: string, cohort: string, subfeature: string}],
4163+
* } | null}
4164+
*/
41544165
__privateAdd(this, _args);
41554166
this.name = name;
41564167
const { bundledConfig, site, platform } = args;
@@ -4213,6 +4224,9 @@
42134224
* @typedef {object} ConditionBlock
42144225
* @property {string[] | string} [domain]
42154226
* @property {object} [urlPattern]
4227+
* @property {object} [experiment]
4228+
* @property {string} [experiment.experimentName]
4229+
* @property {string} [experiment.cohort]
42164230
*/
42174231
/**
42184232
* Takes multiple conditional blocks and returns true if any apply.
@@ -4234,7 +4248,8 @@
42344248
_matchConditionalBlock(conditionBlock) {
42354249
const conditionChecks = {
42364250
domain: this._matchDomainConditional,
4237-
urlPattern: this._matchUrlPatternConditional
4251+
urlPattern: this._matchUrlPatternConditional,
4252+
experiment: this._matchExperimentConditional
42384253
};
42394254
for (const key in conditionBlock) {
42404255
if (!conditionChecks[key]) {
@@ -4245,6 +4260,31 @@
42454260
}
42464261
return true;
42474262
}
4263+
/**
4264+
* Takes a condition block and returns true if the current experiment matches the experimentName and cohort.
4265+
* Expects:
4266+
* ```json
4267+
* {
4268+
* "experiment": {
4269+
* "experimentName": "experimentName",
4270+
* "cohort": "cohort-name"
4271+
* }
4272+
* }
4273+
* ```
4274+
* Where featureName "ContentScopeExperiments" has a subfeature "experimentName" and cohort "cohort-name"
4275+
* @param {ConditionBlock} conditionBlock
4276+
* @returns {boolean}
4277+
*/
4278+
_matchExperimentConditional(conditionBlock) {
4279+
if (!conditionBlock.experiment) return false;
4280+
const experiment = conditionBlock.experiment;
4281+
if (!experiment.experimentName || !experiment.cohort) return false;
4282+
const currentCohorts = this.args?.currentCohorts;
4283+
if (!currentCohorts) return false;
4284+
return currentCohorts.some((cohort) => {
4285+
return cohort.feature === "ContentScopeExperiments" && cohort.subfeature === experiment.experimentName && cohort.cohort === experiment.cohort;
4286+
});
4287+
}
42484288
/**
42494289
* Takes a condtion block and returns true if the current url matches the urlPattern.
42504290
* @param {ConditionBlock} conditionBlock

0 commit comments

Comments
 (0)