Closed Bug 1065307 Opened 10 years ago Closed 10 years ago

Gecko needs to know appId of the currently visible app

Categories

(Firefox OS Graveyard :: NFC, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1105666

People

(Reporter: tauzen, Unassigned)

References

Details

To implement bug 963531 we need to be able to know in Nfc.js the appId of currently visible app. Apps which would like to be notified directly about NFC tag or NFC peer device discovery will need to register onpeerfound/ontagfound event handlers. The corresponding events (peerfound/tagfound) should be fired only to one app which is currently visible. If there is no such app visible, the info about tag/peer discovery will be passed to Gaia System app (NfcManager) which will then launch proper activities. In this bug I would like to discuss the best way get the information about visible app in Gecko, which could be easily retrieved by Nfc.js. I'm filling this bug as NFC because we specifically need this, but this seems to be a general problem and other APIs might benefit from solving it, so the solution should be as generic as possible.
On some platform (eg tablets) there would be no guarantee that we have only one visible app. How do you plan to deal with this kind of situations?
This is an interesting edge case. I don't think this kind of scenario is implemented anywhere right now. From my point of view we could deliver the event to all visible apps (which registered event handlers), but this probably needs some more discussion, also with the UX. I'll raise this topic during the upcoming work week (starts on next Monday) and hopefully get back here with some suggestions how to approach this.
Depends on: 1069177
This bug already implies some API will provide appId information to Gecko whether in Content or Chrome process. But I'd move this to a more general discussion, for example can we use document.hidden, or hasFocus,... etc to determine that content process is in foreground now. So duplicate this as Bug 1082440
Marking as a duplicate, as Yoshi suggested in comment 3.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.