Hello,
According to MDN, Safari v15.4+ should fully support declarativeNetRequest.Redirect, including regexSubstitution, but when I use it in a rule I get this:
Rule:
EXT_PAGE = '/hello.html';
RULES = [{
id: 1,
action: {
type: 'redirect',
redirect: {
regexSubstitution: EXT_PAGE + '#\\0'
},
},
condition: {
requestDomains: ['example.com'],
regexFilter: '^.+$',
resourceTypes: ['main_frame', 'sub_frame'],
},
}];
browser.declarativeNetRequest.updateDynamicRules({
removeRuleIds: RULES.map(r => r.id),
addRules: RULES,
});
Error: Invalid call to declarativeNetRequest.updateDynamicRules(). Error with rule at index 0: Rule with id 1 is invalid.
redirectis missing either aurl,extensionPath, ortransformkey.