On Tue, Jun 19, 2012 at 10:45 AM, Anant Narayanan <[email protected]> wrote:
> I would add that we should also change getSelf/getInstalled should only
> return an app object if the app is natively installed.
>
It would be nice if sites and stores could, instead of prompting the user
to install the app, could prompt them to just natively install the app.
That is, both patterns of use for getSelf and getInstalled could benefit in
some fashion from being able to see available apps:
// getSelf
navigator.mozApps.getSelf().onsuccess = function () {
if (this.result === null) {
var answer = confirm("Install this site as an app?");
if (answer) {
location.href = "https://marketplace.mozilla.org/apps/this-app";
}
}
};
That's not an awesome experience, it would be better if it could be:
navigator.mozApps.getSelf().onsuccess = function () {
... everything in getSelf before ...
if (this.result && this.result.installState != "installed") {
var answer = confirm("Install this app on this device?");
if (answer) {
this.result.install();
}
}
};
And the same thing applies for the store, though it's less concerning as
the store has the original receipt and so can reproduce the installation
exactly (I just tested to see if the store issued a new receipt or not, and
reinstallation gives back exactly the receipt you had before).
It adds complexity to apps/stores to have this available-but-not-installed
state, but would seem to improve the experience, especially for getSelf().
Also, this works better if the install state is an attribute, rather than
inferred through a second call (e.g., getAllSynced()).
(Kind of an aside, but can an app detect if you are browsing to it and have
a native install, and call app.launch() to launch itself in WebRT? I don't
know what if any API is available to see if an app is running in native
mode?)
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps