[DNR] Make sure clearRuleManager is called on extension shutdown
Categories
(WebExtensions :: Request Handling, defect)
Tracking
(firefox113 fixed)
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: rpl, Assigned: rpl)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(1 file)
ExtensionDNR.clearRuleManager is currently being called from the onShutdown lifecycle method defined in the DNR ExtensionAPI subclass, but the onShutdown lifecycle method is only going to be called on extension shutdown if the DNR ExtensionAPI class has been instantiated.
The DNR ExtensionAPI class isn't going to be instantiated unless the extension does either:
- include a
declarative_net_request
property in the manifest.json file - the extension has called a
declarativeNetRequest
API method at least once
When an extension has been installed and some DNR rules are being already registered, e.g. through declarativeNetRequest.updateDynamicRules which doesn't need a declarative_net_request
to be part of the manifest, the rules will be persisted on disk and on the next extension startup DNR make be initialized even if the extension will never call any other declarativeNetRequest
API method anymore, and in that case a RuleManager will be created and registered to ExtensionDNR and then never removed after the extension is shutdown.
We should make sure to register an extension shutdown listener to clear the RuleManager as part of initializing DNR for the same extension, so that it is going to be clearer independently from the declarativeNetRequest
ExtensionAPI class being instantiated or not.
Updated•8 months ago
|
Assignee | ||
Comment 1•8 months ago
|
||
Updated•8 months ago
|
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/cea75783d776 Make sure ExtensionDNR.clearRuleManager is called extension shutdown. r=robwu
Comment 3•8 months ago
|
||
bugherder |
Description
•