Hi Andrey,
Let me try to elaborate on how I am thinking about dynamic rules.
I see two use cases of dynamic rules:
1. Rules added in response to user action. Say disable the extension on
example.com, block all third party scripts etc.
2. Rules pushed to extensions to augment their static rulesets.
Now it's natural to think that rules in 1. should generally always be higher priority than other rules since they were added in response to user action.
For rules added for use case 2., like you said, the way it might work is:
1. New rules are pushed to extensions to augment the static rules.
2. These are added as dynamic rules and override any static rules.
3. The extension is updated, the new rules make it to the static ruleset. Priority of rules within the new published static ruleset is arranged appropriately by the extension devs. (The new rules can still have higher priority than the particular static rules they were supposed to override).
4. Extension deletes the new rules from the set of dynamic rules, so that the only set of dynamic rules remaining are the ones added in response to user action.
It's not clear to me how things break here.
The problems I see with static and dynamic rules sharing the same priority space is:
- Extensions would need to be careful that dynamic rules added in response to user action don't change behavior once the extension is updated. In practice, this would mean the extension maintaining a fixed upper limit of static rule priority across extension updates and a fixed minimum priority for actions added in response to user action. This is easy to get wrong.
- Static rules will have immutable priorities. Adding new dynamic rules to the same priority space would mean additional book-keeping on the part of extensions.
- It's not immediately obvious to me if this solves any additional use case. Let me know if you can think of any.