Skip to content

Commit

Permalink
Internally support no-filtering as default mode
Browse files Browse the repository at this point in the history
Even though this cannot be set through the user interface.
  • Loading branch information
gorhill committed Apr 21, 2023
1 parent 6afe74d commit 8616b39
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions platform/mv3/extension/js/mode-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8616b39

Please sign in to comment.