dropbox/dropbox-js — pull request #79 by vladikoff (2013-05-24 23:24:50+00:00)
Title: Adding Firefox add-on driver support

### [ Feedback needed ]

With this pull request, I would like to add support for Firefox add-ons into this library, just like the existing support for Chrome extensions. So far I have a custom driver and looking for feedback. Due to the add-on security model I have to work around OAuth redirections using the add-on SDK. This driver is based on the pop-up driver and is the first part of this pull request.
My plan is to update this pull request with a working add-on example and documentation.

If you have time, could you review the driver code and provide some feedback?

Some concerns:
* In my testing I always have to re-auth the application as part of the oauth flow.
How can I fix that and not ask the user to re-add the application?
* the Chrome driver checks for DONE, SIGNED_OFF, ERROR, but the Popup one does not. Is this important for this driver?

My current client code:

```
this.client = new Dropbox.Client({
key: "KEY_HERE", sandbox: true
});

this.client.authDriver(new Dropbox.Drivers.Firefox({ rememberUser: true }));

this.client.authenticate({interactive: false}, function (error, client) {
if (error) {
console.log(error);
}
console.log(client.isAuthenticated());
if (client.isAuthenticated()) {
// Cached credentials are available, make Dropbox API calls.
window.dispatchEvent(new CustomEvent("from-content", {detail: { name: "getTabs" }}));
}
});
````

Thanks!