Internally support no-filtering as default mode

Even though this cannot be set through the user interface.
This commit is contained in:
Raymond Hill 2023-04-21 19:24:43 -04:00
parent 6afe74d584
commit 8616b395b2
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -131,13 +131,17 @@ async function setFilteringModeDetails(afterDetails) {
id: TRUSTED_DIRECTIVE_BASE_RULE_ID,
action: { type: 'allowAllRequests' },
condition: {
requestDomains: [],
resourceTypes: [ 'main_frame' ],
},
priority: 100,
};
if ( actualDetails.none.size ) {
rule.condition.requestDomains = Array.from(actualDetails.none);
if ( actualDetails.none.size !== 0 ) {
if (
actualDetails.none.size !== 1 ||
actualDetails.none.has('all-urls') === false
) {
rule.condition.requestDomains = Array.from(actualDetails.none);
}
addRules.push(rule);
dynamicRuleMap.set(TRUSTED_DIRECTIVE_BASE_RULE_ID, rule);
}