Bug 1638099 - Unregister all extension service workers on extension shutdown if the...
commit4f6b894e7a714b4e6acda8532e585381cf786a1b
authorLuca Greco <lgreco@mozilla.com>
Mon, 26 Jul 2021 17:52:24 +0000 (26 17:52 +0000)
committerLuca Greco <lgreco@mozilla.com>
Mon, 26 Jul 2021 17:52:24 +0000 (26 17:52 +0000)
tree31140b5d238b5c3e41675febeff6671c182af0dd
parent38acfa9c75893635b1e7498b6c3b5a5ebb3ad08f
Bug 1638099 - Unregister all extension service workers on extension shutdown if the app is not also shutting down. r=mixedpuppy

This patch introduces changes to parent/ext-backgroundPage.js and Extension's shutdown methods to make sure
that all service workers registered by an extension are unregistered when the extension is shutting down,
unless the application is also shutting down (in which case the registration is not unregistered because
for the already installed extenson the previously activeWorker is expected to be still active across browser
restarts).

These changes prevent also to hit the issue that D119532 was triggering when an extension was reloaded
and it does not need any of the changes to ContentPrincipal::AddonPolicy from D119531.

Differential Revision: https://phabricator.services.mozilla.com/D119903
toolkit/components/extensions/Extension.jsm
toolkit/components/extensions/parent/ext-backgroundPage.js