-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should dNR dynamic rules reset on update? #251
Comments
The Google documentation says:
So to me it looks like Chrome implementation doesn't follow it. And this is inconsistent. Note on clearing the rules: this requires calling |
Except Because they are not clear, from a developer's point of view, I would clear and re-create them like below code, thus I don't have to care about how the browser handle them. There is a discussion for dynamic content script.
Developers can save these dynamic created items in storage, so they can restore them when browser restart or extension update. |
This is what I always do. Also, it is possible that during extension's lifespan, content script will be moved (path change), alarms renamed, contextMenu command names or button text updated, etc.. So registrations for older extension versions might not be relevant anymore and it is always conceptually easier/safer to just re-register them just in case. |
@dotproto While you did mention that dynamic rules are cleared, I tested the implementation and it looks like that is not the case. On the contrary, there is a bug in Chrome that prevents dynamic rules from being removed on uninstall (https://crbug.com/1302900). When I trace the implementation, it looks like dynamic rules are intentionally kept, and only (intended/supposed to be) removed on uninstall. For example, here's internal documentation on the intended behavior of dynamic rule updates: https://source.chromium.org/chromium/chromium/src/+/main:extensions/browser/extension_prefs.cc;l=223-230;drc=7aa346a8ba6f861859a392d241ee8246303e94c6 |
Changing
follow-up: chrome
"opposed" in this group means "There is consensus that dynamic rules should not reset on update". In other words, that dynamic rules are persisted across extension updates. Chrome will keep the current behavior (i.e. keeping dynamic rules on update). @oliverdunk will take care of ensuring that Chrome's documentation clarifies that dynamic rules are persistent. I'll comment on the crbug to let the crbug owner know about this agreement, so that even if the crbug (https://crbug.com/1302900 - dynamic rules kept after uninstall) is fixed, that dynamic rules are still preserved across updates. |
Chrome currently resets any dynamic dNR rules on extension update in the effort to force extensions to keep their static rules and dynamic rules in sync. Without this reset, any previously added dynamic rules might conflict with newly added static rules in the update.
Safari does not reset dynamic dNR rules on update and the extension could clear them and reapply any if needed.
I feel that a reset like in Chrome could potentially and surprisingly delete user generated content blocking rules that would require additional storage and management steps by the extension to preserve the rules and reapply them.
The text was updated successfully, but these errors were encountered: