Closed Bug 815272 Opened 12 years ago Closed 12 years ago

Doesn't see that an app is installed, navigator.mozApps.getSelf().onsuccess doesn't happen

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set
normal

Tracking

(blocking-basecamp:-)

RESOLVED INVALID
blocking-basecamp -

People

(Reporter: martijn.martijn, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: regression, testcase)

Steps to reproduce:
- Go to http://competitie-app.kantjils.nl/
- Click on the INSTALL button (after that, the button changes into INSTALLED!)
- Reload the page

Expected result:
- The button shows UNINSTALL

Actual result:
- The button shows INSTALL

This is only an issue with trunk Firefox, I don't see this problem with Firefox 17.0.
Assignee: ianb → nobody
Component: HTML → DOM: Apps
Product: Web Apps → Core
Version: unspecified → Trunk
Are you able to reproduce this on b2g by any chance?
(In reply to Jason Smith [:jsmith] from comment #1)
> Are you able to reproduce this on b2g by any chance?

Just checked - it's reproducible on b2g. Noming then...
blocking-basecamp: --- → ?
OS: Windows 7 → All
Hardware: x86 → All
This is not really a regression, but due to a bug fixed between 17 and 18. The relevant code is at https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#1527, and here's what this does:

Instead of just checking the origin of the current page to know if we're the app, we also make sure that we are actually running the app itself, not that we simply navigated to the app index in a web browser.

In your test case, we never launch the app itself, so the install page is not running as an app and getSelf() never returns the app you installed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Ok, how do I test from inside the web page that the particular app from that web page is installed, then?

I installed the web app from trunk, then opened the web app shortcut that was added to the desktop, but then I still get the INSTALL button. Shouldn't I get the UNINSTALL button then?
(In reply to Martijn Wargers [:mw22] (QA - IRC nick: mw22) from comment #4)
> I installed the web app from trunk, then opened the web app shortcut that
> was added to the desktop, but then I still get the INSTALL button. Shouldn't
> I get the UNINSTALL button then?

That doesn't work in Firefox 17 either. I guess it's not supposed to work then?
blocking-basecamp: ? → -
You'll want to use checkInstalled here instead.
Ok, thanks, I didn't see that in:
https://developer.mozilla.org/en-US/docs/Apps/Getting_Started#Checking_whether_the_app_is_installed
I guess that's something that needs to be documented then.
Ok, that is working now.
But now the uninstall() part of the code seems to be broken. Not sure what I'm doing wrong here.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.