Closed Bug 711131 Opened 13 years ago Closed 13 years ago

implement uninstall() method

Categories

(Web Apps :: HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mhanson, Assigned: ianbicking)

References

Details

(Whiteboard: [production-affected])

For parity with the Gecko API [1], the HTML implementation should support an uninstall() method exposed to content. It should be subject to stringent security checks: The current algorithm is that an application in allowed to uninstall itself, or an application that it installed. [1] http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/apps/nsIDOMApplicationRegistry.idl
Blocks: 711138
The current implementation is even more stringent: only application having the "webapps-manage" privilege can use uninstall(). There's no reason a store could silently delete apps you buyed/installed I think.
There's a corner-case, though: handling refunds. If the user has requested a refund, and the store has processed it, the user is left with an app which will never work. We could choose to make deleting this app the user's responsibility, but that is probably error-prone. So providing some path for the store to delete the app in this case is probably useful. There's nothing that says it has to be "silent", though - we could definitely do a consent step.
(In reply to Michael Hanson from comment #2) > There's a corner-case, though: handling refunds. > > If the user has requested a refund, and the store has processed it, the user > is left with an app which will never work. We could choose to make deleting > this app the user's responsibility, but that is probably error-prone. So > providing some path for the store to delete the app in this case is probably > useful.> The store should have a way to remove invalid receipts (though we don't have any methods for that currently). If the app (through its manifest) could indicate it required a receipt, would it be sensible to hide the application once the store has removed the last valid receipt? This also adds an application state that is essentially available-but-probably-won't-work, which is perhaps a good state to have, we could present these apps elsewhere in a way that helps the user track what has happened. (For that matter, being able to mark a receipt as invalid without removing the receipt might itself be a useful feature.)
Addition to just the HTML implementation: https://github.com/mozilla/openwebapps/pull/158 This does not change the permission model for HTML (which is currently just a whitelist).
This is a API-level bug in the HTML implementation. Probably should have David Clarke verify this bug.
QA Contact: dclarke
Ian, to verify this bug, what should QA be looking for? Are we testing to make sure uninstalling an application still works on the HTML 5 dashboard?
Also - On the API-level, should I basically test this function (https://developer.mozilla.org/en/Apps/Apps_JavaScript_API/navigator.mozApps.mgmt.uninstall) in the specification and make sure it abides by the specification?
Actually disregard comment 7 (the API has changed, uninstall() takes no params according to the first comment).
Something like this should work (on a privileged page): navigator.mozApps.getAll().onsuccess = function () { this.result[0].uninstall().onsuccess = function () {alert('success!');}; }; There are also tests in repo_api.html for this.
Whiteboard: [staging-fixed]
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Verified 03/30/2012. Works for me.
Whiteboard: [staging-fixed] → [production-affected]
You need to log in before you can comment on or make changes to this bug.