Closed Bug 1021293 Opened 11 years ago Closed 10 years ago

Implement Firefox Accounts feature detection

Categories

(Marketplace Graveyard :: Integration, defect, P1)

2014-Q2
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: delza, Assigned: ashort)

References

Details

(Whiteboard: [qa-])

On FirefoxOS 2.0 (and any other version of Firefox that supports it) we want to use the built-in Firefox Accounts API, while elsewhere we want to fall back to a web-based interaction with Firefox Accounts.
Assignee: nobody → delza
Blocks: 1007956
Priority: -- → P1
See Also: → 1009849
Blocks: 1021297
According to MDN (https://developer.mozilla.org/en-US/docs/Firefox-Accounts-on-FirefoxOS#Native_Services) there should be a property on the `navigator` object called `mozId` which implements Firefox Accounts (FxA). This is also where Persona gets implemented, so we need to test for the property's existence, and also for FxA support on the property. There is also some disconnect about what the property is actually called (https://bugzilla.mozilla.org/show_bug.cgi?id=1014077 suggests that it should be `navigator.mozAccounts` rather than `navigator.mozId` and looking at the console, it appears to be implemented as `navigator.id` rather than `navigator.mozId`. Nightly has a property `navigator.mozId` but it is null. When we are in Marketplace, it gets at stubbed-in property `navigator.id` which implements `watch()` and also has the property `_shimmed`. Trying to use this watch method for FxA using the instructions on the MDN page above (but on navigator.id) throws 'Error: stateless api only allows onlogin option'. Nightly on Firefox appears to work the same as desktop, but I need to test more. FxOS 1.3 has implemented `navigator.mozId` but not `navigator.id` or `navigator.mozAccounts`. Trying to use it as above throws a generic Error with no message text at all.
Lets do UA detection to distinguish Firefox OS 2.0 and greater.
Assignee: delza → robhudson.mozbugs
Wow. OK then. For the record I wanted a favourite button for this comment: https://bugzilla.mozilla.org/show_bug.cgi?id=1009849#c16 Here's the guide to UA detection: https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference
Assignee: robhudson.mozbugs → ashort
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Please add STR here or mark it with [qa-] if no QA is needed.
Flags: needinfo?(ashort)
For now we are using the webflow everywhere.
Whiteboard: [qa-]
Flags: needinfo?(ashort)
You need to log in before you can comment on or make changes to this bug.