1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

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);
}