Closed Bug 652653 Opened 14 years ago Closed 13 years ago

Implement window object that hosts verified email API

Categories

(Cloud Services :: Server: Identity, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 664614

People

(Reporter: ddahl, Unassigned)

References

Details

Attachments

(1 file, 6 obsolete files)

Implement an nsIDOMGlobalPropertyInitializer object to host verifiecation APIs and session APIs
Assignee: nobody → ddahl
Dan: What sync apis do I need to know about for looking up a potential verified email address?
Attached patch v 0.1 WIP mostly boilerplate (obsolete) — Splinter Review
Just getting the bits in place to being writing a test suite to develop against
No longer depends on: 652610
After speaking with dougt, who has implemented several navigator properties, you make the navigator on nsGlobalWindow implement a new interface just like he did for nsIDOMNavigatorDesktopNotification jst also recommended eagerly creating a getter via the "content-document-global-created" topic. this way code loads quite lazily and we can avoid the C++ interface patch.
/Cc JR who can provide some help on what APIs to use to get ID assertions and such
https://wiki.mozilla.org/Services/Identity/InternalSpec provides a list of the API points, values and results. an alpha server is available for testing purposes. I can assist in getting the server operational in a test configuration.
using Object.createProperty() to add the property to window.navigator. Seems like pretty solid approach instead of spelunking nsGlobalWindow.cpp:)
Attachment #528185 - Attachment is obsolete: true
Still digging deep into how the existing web client works, porting concepts over to mozilla/services/ code
Attachment #528749 - Attachment is obsolete: true
Attached patch v 0.4 wrapper problem (obsolete) — Splinter Review
There is something wrapper related that prevents me from accessing the navigator.id property from inside a browser chrome test. it is always undefined. If I just launch the build, I can access the navigator.id property from content via the web console.
Attachment #529257 - Attachment is obsolete: true
bz: I am doing this to add a property to window.navigator: Object.defineProperty(aWindow.navigator, "id", { value: idApi, enumerable: true, configurable: false }); Not sure if this is why I cannot access the property from inside a browser chrome test? Manually testing from content script I can see the new property.
Is your chrome test looking at the XRayWrapper for window.navigator, or at the .wrappedJSObject? The former won't show "id", of course; the latter should. As a side question, is there a reason you're setting this up as a non-configurable property? Is that how IDL-defined props are set up?
(In reply to comment #10) > Is your chrome test looking at the XRayWrapper for window.navigator, or at the > .wrappedJSObject? The former won't show "id", of course; the latter should. > I get an XRayWrapper, and have tried 2 ways: var window = browser.contentDocument.defaultView.wrappedJSObject; var ID = window.navigator.id; and: var window = XPCNativeWrapper.unwrap(browser.contentDocument.defaultView); var ID = window.navigator.id; as well as calling unwrap() and .wrappedJSObject on the navigator object directly. My new property, 'id', is always undefined. (Somehow, wrappers are still mysterious to me) > As a side question, is there a reason you're setting this up as a > non-configurable property? Is that how IDL-defined props are set up? I was just experimenting with 'configurable: false', since it seems the rest of the properties on navigator are immutable (the ones i tried to replace anyway)
That's .... odd. What about this: var ID = browser.contentDocument.defaultView.navigator.wrappedJSObject.id; ?
(In reply to comment #12) > That's .... odd. What about this: > > var ID = browser.contentDocument.defaultView.navigator.wrappedJSObject.id; > > ? I still get 'undefined' I just ran the build and was able to access the property via the web console.
Just went through the trouble of setting up mochitest-plain for this code. The mochitest can access the navigator property I added without any trouble. Perhaps mochitest-plain is a better way to test this object anyway as it is a content-accessible dom property. I wonder if the wrapper is dropping access to the property because it is not in the Navigator's idl or something like that?
XRayWrapper does exactly that. But if you use .wrappedJSObject it should work.
Going to test this via mochitest-plain instead of chrome browser tests
Attachment #529881 - Attachment is obsolete: true
Attachment #530178 - Attachment is obsolete: true
Attachment #530457 - Attachment is obsolete: true
Assignee: ddahl → nobody
Component: Account Manager → Server: Identity
Product: Firefox → Mozilla Services
QA Contact: account.manager → identity-server
Version: Trunk → unspecified
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: