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
1 changed files with 7 additions and 3 deletions

View File

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