Open Bug 1572228 Opened 2 years ago Updated 2 years ago

Clean up origin storage when the extension hosting the protocol is uninstalled


(WebExtensions :: Experiments, enhancement, P3)



(Not tracked)


(Reporter: irakli, Unassigned)


(Depends on 1 open bug, Blocks 1 open bug, )


As per

The protocol mechanism actually creates the origins they look like, which can result in persistent storage being used across the browser: cookies, localStorage, IndexedDB, etc. It's necessary/appropriate to clean up this storage when the extension that created the protocol is uninstalled as nothing else will. The primary rationale is privacy, but it's also good to not waste the user's disk-space.

Currently, WebExtensions clear the storage of the moz-extension origin for the WebExtension at You can see the call to clearStoragesForPrincipal on nsIQuotaManager which wipes out all storage for the extension itself, plus a separate call to wipe the overloaded use of userContextId for the "storage.local" backend (which is not directly visible to the extension). This or something is an appropriate place to wipe the registered protocol origins.

I thought QuotaManager had a way to perform this clearing already, but it turns out I was wrong. now tracks making this clearing possible.

Note that for cases where there's a reason to keep the storage around, the WebExtensions logic already supports a "extensions.webextensions.keepStorageOnUninstall" preference which leaves a WebExtension's storage around. This is really only appropriate for extension development profiles temporarily loading extensions over and over via about:debugging, however. It shouldn't be used as a mechanism to allow users to persist data... at that point I think real UX is needed.

Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.