Closed Bug 1293035 Opened 8 years ago Closed 8 years ago

Uninstallation cleanup for webextensions

Categories

(WebExtensions :: Untriaged, defect)

50 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1213990

People

(Reporter: dburghuber, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36

Steps to reproduce:

WebExtension's API currently provides no onInstalled (https://bugzilla.mozilla.org/show_bug.cgi?id=1252871) or onUninstall event from browser.runtime (a.k.a. chrome.runtime).

In the interim, for an extension to observe itself as a new installation the current workaround would be to examine extension storage for a previous manually set version number. If that exists then the extension is not on its 1st run following installation (as it has already run to populate <user_profile>/browser-extension-data/<extension_id>/storage.json with a version record). But if that record doesn't exist we can assume a post-install 1st run.

Important note:
The installation is made via about:debugging -> Load temporary add-on
The uninstallation is made via about:addons -> Remove
This is a logically sound workaround for current lack of browser.runtime.onInstalled. 


Actual results:

The workaround solution works on a true 1st installation (never installed and firefox profile before), but currently falls flat on repeated installation (i.e. install, uninstall, then reinstall)

This is because the webextensions API does not currently clean up extension storage data (i.e. remove  <user_profile>/browser-extension-data/<extension_id>/) when an extension is removed.

Clearing all user history does not remove browser-extension-data/<extension_id>/storage.js. Neither does removing the extension, quitting firefox and relaunching.



Expected results:

With no browser.runtime.onUninstall event an extension cannot be expected to perform any clean up of its own data. It is up to the WebExtensions API to manage this and it currently doesn't (at least when using the installation an removal methods described in my "Important note").

This isn't just an issue relating to enabling a temporary workaround solution for determining post-install runs, we have product to release very soon and the product will not only go through Firefox review processes, but also a separate review process with our product partner (Yahoo). One of their review criterion is that a product clean up after itself on uninstall.

WebExtensions doesn't provide any hook for extensions to know they are about to be uninstalled (i.e. runtime.onUninstall), instead the WebExtensions API and Firefox itself manage lifetime of an extension.

Therefore the WebExtensions API should at least cleanup an extension's data from a user's profile after the extension is removed.
Typo:

Actual results:

The workaround solution works on a true 1st installation (never installed *IN A* firefox profile before)
QA Whiteboard: [bugday-20160808]
Component: Untriaged → WebExtensions
Product: Firefox → Toolkit
(In reply to bugz - wujiweb from comment #1)
> Typo:
> 
> Actual results:
> 
> The workaround solution works on a true 1st installation (never installed
> *IN A* firefox profile before)

Currently i have the same problem and i have been waiting for a solution for a month because i am deploying a extension for my company.

But i have been following this thread https://bugzilla.mozilla.org/show_bug.cgi?id=1213990
So it seems that already it have been fixed.
Flags: needinfo?(aswan)
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(aswan)
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.