Enable Dropbox login in Firefox add-on

The standard OAuth redirect flow does not work
in the context of a Firefox add-on where the original
page is at a resource:// URL since redirects
from http:// -> resource:// URLs by a
content or page script appear to be disallowed

This fixes the issue by having the OAuth flow redirect
back to a dummy http://localhost URL after authentication.

The add-on's priviledged main script then intercepts the redirect and
redirects the panel's content URL back to the app.

There are a couple of issues with the current implementation:

 * There can be a flash of an error page after the OAuth
   flow before the main app is reloaded.

 * A hack is used to prevent dropbox-js trying to remove the
   access credentials from window.location.hash after authentication
   completes as the window.history.replaceState() call fails
   and results in the rest of the page failing to load.