Skip to content

Commit c46231f

Browse files
brianhallgithub-actions[bot]
authored andcommitted
Release build 10.9.0 [ci release]
1 parent 782c3fd commit c46231f

File tree

18 files changed

+654
-296
lines changed

18 files changed

+654
-296
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Duck Player: Change Playlist URL behavior (#1787)
1+
- Add conditional action type (#1799)

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4460,11 +4460,11 @@
44604460
matchConditionalFeatureSetting(featureKeyName) {
44614461
const conditionalChanges = this._getFeatureSettings()?.[featureKeyName] || [];
44624462
return conditionalChanges.filter((rule) => {
4463-
let condition = rule.condition;
4464-
if (condition === void 0 && "domain" in rule) {
4465-
condition = this._domainToConditonBlocks(rule.domain);
4463+
let condition2 = rule.condition;
4464+
if (condition2 === void 0 && "domain" in rule) {
4465+
condition2 = this._domainToConditonBlocks(rule.domain);
44664466
}
4467-
return this._matchConditionalBlockOrArray(condition);
4467+
return this._matchConditionalBlockOrArray(condition2);
44684468
});
44694469
}
44704470
/**
@@ -10749,29 +10749,9 @@ ul.messages {
1074910749

1075010750
// src/features/broker-protection/actions/expectation.js
1075110751
init_define_import_meta_trackerLookup();
10752-
function expectation(action, root = document) {
10753-
const results = expectMany(action.expectations, root);
10754-
const errors = results.filter((x2, index) => {
10755-
if (x2.result === true) return false;
10756-
if (action.expectations[index].failSilently) return false;
10757-
return true;
10758-
}).map((x2) => {
10759-
return "error" in x2 ? x2.error : "unknown error";
10760-
});
10761-
if (errors.length > 0) {
10762-
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
10763-
}
10764-
const runActions = results.every((x2) => x2.result === true);
10765-
if (action.actions?.length && runActions) {
10766-
return new SuccessResponse({
10767-
actionID: action.id,
10768-
actionType: action.actionType,
10769-
response: null,
10770-
next: action.actions
10771-
});
10772-
}
10773-
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
10774-
}
10752+
10753+
// src/features/broker-protection/utils/expectations.js
10754+
init_define_import_meta_trackerLookup();
1077510755
function expectMany(expectations, root) {
1077610756
return expectations.map((expectation2) => {
1077710757
switch (expectation2.type) {
@@ -10850,6 +10830,31 @@ ul.messages {
1085010830
return { result: true };
1085110831
}
1085210832

10833+
// src/features/broker-protection/actions/expectation.js
10834+
function expectation(action, root = document) {
10835+
const results = expectMany(action.expectations, root);
10836+
const errors = results.filter((x2, index) => {
10837+
if (x2.result === true) return false;
10838+
if (action.expectations[index].failSilently) return false;
10839+
return true;
10840+
}).map((x2) => {
10841+
return "error" in x2 ? x2.error : "unknown error";
10842+
});
10843+
if (errors.length > 0) {
10844+
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
10845+
}
10846+
const runActions = results.every((x2) => x2.result === true);
10847+
if (action.actions?.length && runActions) {
10848+
return new SuccessResponse({
10849+
actionID: action.id,
10850+
actionType: action.actionType,
10851+
response: null,
10852+
next: action.actions
10853+
});
10854+
}
10855+
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
10856+
}
10857+
1085310858
// src/features/broker-protection/actions/navigate.js
1085410859
init_define_import_meta_trackerLookup();
1085510860

@@ -11634,6 +11639,31 @@ ul.messages {
1163411639
return new SuccessResponse({ actionID, actionType, response });
1163511640
}
1163611641

11642+
// src/features/broker-protection/actions/condition.js
11643+
init_define_import_meta_trackerLookup();
11644+
function condition(action, root = document) {
11645+
const results = expectMany(action.expectations, root);
11646+
const errors = results.filter((x2, index) => {
11647+
if (x2.result === true) return false;
11648+
if (action.expectations[index].failSilently) return false;
11649+
return true;
11650+
}).map((x2) => {
11651+
return "error" in x2 ? x2.error : "unknown error";
11652+
});
11653+
if (errors.length > 0) {
11654+
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
11655+
}
11656+
const returnActions = results.every((x2) => x2.result === true);
11657+
if (action.actions?.length && returnActions) {
11658+
return new SuccessResponse({
11659+
actionID: action.id,
11660+
actionType: action.actionType,
11661+
response: { actions: action.actions }
11662+
});
11663+
}
11664+
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
11665+
}
11666+
1163711667
// src/features/broker-protection/execute.js
1163811668
async function execute(action, inputData, root = document) {
1163911669
try {
@@ -11652,6 +11682,8 @@ ul.messages {
1165211682
return await getCaptchaInfo2(action, root);
1165311683
case "solveCaptcha":
1165411684
return solveCaptcha2(action, data(action, inputData, "token"), root);
11685+
case "condition":
11686+
return condition(action, root);
1165511687
default: {
1165611688
return new ErrorResponse({
1165711689
actionID: action.id,
@@ -11769,7 +11801,7 @@ ul.messages {
1176911801
maxAttempts: 30
1177011802
};
1177111803
}
11772-
if (!retryConfig && action.actionType === "expectation") {
11804+
if (!retryConfig && (action.actionType === "expectation" || action.actionType === "condition")) {
1177311805
if (action.expectations.some((x2) => x2.type === "element")) {
1177411806
return {
1177511807
interval: { ms: 1e3 },

build/android/brokerProtection.js

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,11 +4426,11 @@
44264426
matchConditionalFeatureSetting(featureKeyName) {
44274427
const conditionalChanges = this._getFeatureSettings()?.[featureKeyName] || [];
44284428
return conditionalChanges.filter((rule) => {
4429-
let condition = rule.condition;
4430-
if (condition === void 0 && "domain" in rule) {
4431-
condition = this._domainToConditonBlocks(rule.domain);
4429+
let condition2 = rule.condition;
4430+
if (condition2 === void 0 && "domain" in rule) {
4431+
condition2 = this._domainToConditonBlocks(rule.domain);
44324432
}
4433-
return this._matchConditionalBlockOrArray(condition);
4433+
return this._matchConditionalBlockOrArray(condition2);
44344434
});
44354435
}
44364436
/**
@@ -7470,29 +7470,9 @@
74707470

74717471
// src/features/broker-protection/actions/expectation.js
74727472
init_define_import_meta_trackerLookup();
7473-
function expectation(action, root = document) {
7474-
const results = expectMany(action.expectations, root);
7475-
const errors = results.filter((x2, index) => {
7476-
if (x2.result === true) return false;
7477-
if (action.expectations[index].failSilently) return false;
7478-
return true;
7479-
}).map((x2) => {
7480-
return "error" in x2 ? x2.error : "unknown error";
7481-
});
7482-
if (errors.length > 0) {
7483-
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
7484-
}
7485-
const runActions = results.every((x2) => x2.result === true);
7486-
if (action.actions?.length && runActions) {
7487-
return new SuccessResponse({
7488-
actionID: action.id,
7489-
actionType: action.actionType,
7490-
response: null,
7491-
next: action.actions
7492-
});
7493-
}
7494-
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
7495-
}
7473+
7474+
// src/features/broker-protection/utils/expectations.js
7475+
init_define_import_meta_trackerLookup();
74967476
function expectMany(expectations, root) {
74977477
return expectations.map((expectation2) => {
74987478
switch (expectation2.type) {
@@ -7571,6 +7551,31 @@
75717551
return { result: true };
75727552
}
75737553

7554+
// src/features/broker-protection/actions/expectation.js
7555+
function expectation(action, root = document) {
7556+
const results = expectMany(action.expectations, root);
7557+
const errors = results.filter((x2, index) => {
7558+
if (x2.result === true) return false;
7559+
if (action.expectations[index].failSilently) return false;
7560+
return true;
7561+
}).map((x2) => {
7562+
return "error" in x2 ? x2.error : "unknown error";
7563+
});
7564+
if (errors.length > 0) {
7565+
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
7566+
}
7567+
const runActions = results.every((x2) => x2.result === true);
7568+
if (action.actions?.length && runActions) {
7569+
return new SuccessResponse({
7570+
actionID: action.id,
7571+
actionType: action.actionType,
7572+
response: null,
7573+
next: action.actions
7574+
});
7575+
}
7576+
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
7577+
}
7578+
75747579
// src/features/broker-protection/actions/navigate.js
75757580
init_define_import_meta_trackerLookup();
75767581

@@ -8355,6 +8360,31 @@
83558360
return new SuccessResponse({ actionID, actionType, response });
83568361
}
83578362

8363+
// src/features/broker-protection/actions/condition.js
8364+
init_define_import_meta_trackerLookup();
8365+
function condition(action, root = document) {
8366+
const results = expectMany(action.expectations, root);
8367+
const errors = results.filter((x2, index) => {
8368+
if (x2.result === true) return false;
8369+
if (action.expectations[index].failSilently) return false;
8370+
return true;
8371+
}).map((x2) => {
8372+
return "error" in x2 ? x2.error : "unknown error";
8373+
});
8374+
if (errors.length > 0) {
8375+
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
8376+
}
8377+
const returnActions = results.every((x2) => x2.result === true);
8378+
if (action.actions?.length && returnActions) {
8379+
return new SuccessResponse({
8380+
actionID: action.id,
8381+
actionType: action.actionType,
8382+
response: { actions: action.actions }
8383+
});
8384+
}
8385+
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
8386+
}
8387+
83588388
// src/features/broker-protection/execute.js
83598389
async function execute(action, inputData, root = document) {
83608390
try {
@@ -8373,6 +8403,8 @@
83738403
return await getCaptchaInfo2(action, root);
83748404
case "solveCaptcha":
83758405
return solveCaptcha2(action, data(action, inputData, "token"), root);
8406+
case "condition":
8407+
return condition(action, root);
83768408
default: {
83778409
return new ErrorResponse({
83788410
actionID: action.id,
@@ -8490,7 +8522,7 @@
84908522
maxAttempts: 30
84918523
};
84928524
}
8493-
if (!retryConfig && action.actionType === "expectation") {
8525+
if (!retryConfig && (action.actionType === "expectation" || action.actionType === "condition")) {
84948526
if (action.expectations.some((x2) => x2.type === "element")) {
84958527
return {
84968528
interval: { ms: 1e3 },

build/integration/contentScope.js

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5769,11 +5769,11 @@
57695769
matchConditionalFeatureSetting(featureKeyName) {
57705770
const conditionalChanges = this._getFeatureSettings()?.[featureKeyName] || [];
57715771
return conditionalChanges.filter((rule) => {
5772-
let condition = rule.condition;
5773-
if (condition === void 0 && "domain" in rule) {
5774-
condition = this._domainToConditonBlocks(rule.domain);
5772+
let condition2 = rule.condition;
5773+
if (condition2 === void 0 && "domain" in rule) {
5774+
condition2 = this._domainToConditonBlocks(rule.domain);
57755775
}
5776-
return this._matchConditionalBlockOrArray(condition);
5776+
return this._matchConditionalBlockOrArray(condition2);
57775777
});
57785778
}
57795779
/**
@@ -17998,29 +17998,9 @@ ul.messages {
1799817998

1799917999
// src/features/broker-protection/actions/expectation.js
1800018000
init_define_import_meta_trackerLookup();
18001-
function expectation(action, root = document) {
18002-
const results = expectMany(action.expectations, root);
18003-
const errors = results.filter((x2, index) => {
18004-
if (x2.result === true) return false;
18005-
if (action.expectations[index].failSilently) return false;
18006-
return true;
18007-
}).map((x2) => {
18008-
return "error" in x2 ? x2.error : "unknown error";
18009-
});
18010-
if (errors.length > 0) {
18011-
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
18012-
}
18013-
const runActions = results.every((x2) => x2.result === true);
18014-
if (action.actions?.length && runActions) {
18015-
return new SuccessResponse({
18016-
actionID: action.id,
18017-
actionType: action.actionType,
18018-
response: null,
18019-
next: action.actions
18020-
});
18021-
}
18022-
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
18023-
}
18001+
18002+
// src/features/broker-protection/utils/expectations.js
18003+
init_define_import_meta_trackerLookup();
1802418004
function expectMany(expectations, root) {
1802518005
return expectations.map((expectation2) => {
1802618006
switch (expectation2.type) {
@@ -18099,6 +18079,31 @@ ul.messages {
1809918079
return { result: true };
1810018080
}
1810118081

18082+
// src/features/broker-protection/actions/expectation.js
18083+
function expectation(action, root = document) {
18084+
const results = expectMany(action.expectations, root);
18085+
const errors = results.filter((x2, index) => {
18086+
if (x2.result === true) return false;
18087+
if (action.expectations[index].failSilently) return false;
18088+
return true;
18089+
}).map((x2) => {
18090+
return "error" in x2 ? x2.error : "unknown error";
18091+
});
18092+
if (errors.length > 0) {
18093+
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
18094+
}
18095+
const runActions = results.every((x2) => x2.result === true);
18096+
if (action.actions?.length && runActions) {
18097+
return new SuccessResponse({
18098+
actionID: action.id,
18099+
actionType: action.actionType,
18100+
response: null,
18101+
next: action.actions
18102+
});
18103+
}
18104+
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
18105+
}
18106+
1810218107
// src/features/broker-protection/actions/navigate.js
1810318108
init_define_import_meta_trackerLookup();
1810418109

@@ -18883,6 +18888,31 @@ ul.messages {
1888318888
return new SuccessResponse({ actionID, actionType, response });
1888418889
}
1888518890

18891+
// src/features/broker-protection/actions/condition.js
18892+
init_define_import_meta_trackerLookup();
18893+
function condition(action, root = document) {
18894+
const results = expectMany(action.expectations, root);
18895+
const errors = results.filter((x2, index) => {
18896+
if (x2.result === true) return false;
18897+
if (action.expectations[index].failSilently) return false;
18898+
return true;
18899+
}).map((x2) => {
18900+
return "error" in x2 ? x2.error : "unknown error";
18901+
});
18902+
if (errors.length > 0) {
18903+
return new ErrorResponse({ actionID: action.id, message: errors.join(", ") });
18904+
}
18905+
const returnActions = results.every((x2) => x2.result === true);
18906+
if (action.actions?.length && returnActions) {
18907+
return new SuccessResponse({
18908+
actionID: action.id,
18909+
actionType: action.actionType,
18910+
response: { actions: action.actions }
18911+
});
18912+
}
18913+
return new SuccessResponse({ actionID: action.id, actionType: action.actionType, response: null });
18914+
}
18915+
1888618916
// src/features/broker-protection/execute.js
1888718917
async function execute(action, inputData, root = document) {
1888818918
try {
@@ -18901,6 +18931,8 @@ ul.messages {
1890118931
return await getCaptchaInfo2(action, root);
1890218932
case "solveCaptcha":
1890318933
return solveCaptcha2(action, data(action, inputData, "token"), root);
18934+
case "condition":
18935+
return condition(action, root);
1890418936
default: {
1890518937
return new ErrorResponse({
1890618938
actionID: action.id,
@@ -19018,7 +19050,7 @@ ul.messages {
1901819050
maxAttempts: 30
1901919051
};
1902019052
}
19021-
if (!retryConfig && action.actionType === "expectation") {
19053+
if (!retryConfig && (action.actionType === "expectation" || action.actionType === "condition")) {
1902219054
if (action.expectations.some((x2) => x2.type === "element")) {
1902319055
return {
1902419056
interval: { ms: 1e3 },

0 commit comments

Comments
 (0)