[mv3] Fix overzealous strict-blocking in Safari

This commit is contained in:
Raymond Hill 2025-04-28 10:56:43 -04:00
parent e048790036
commit 526af62864
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -53,6 +53,12 @@ const prepareUpdateRules = optionsBefore => {
const { addRules, removeRuleIds } = optionsBefore;
const addRulesAfter = addRules?.filter(isSupportedRule);
if ( Boolean(addRulesAfter?.length || removeRuleIds?.length) === false ) { return; }
addRulesAfter.forEach(r => {
if ( r.action.redirect?.regexSubstitution === undefined ) { return; }
if ( r.condition.requestDomains === undefined ) { return; }
r.condition.domains = r.condition.requestDomains;
delete r.condition.requestDomains;
});
const optionsAfter = {};
if ( addRulesAfter?.length ) { optionsAfter.addRules = addRulesAfter; }
if ( removeRuleIds?.length ) { optionsAfter.removeRuleIds = removeRuleIds; }