I'm porting my application to Electron and I was surprised to find out that the Dropbox authentication doesn't work in this environment. It does work in Chrome though.
The sign-in buttons remain disabled and the labels appear over the inputs.
The following message is displayed in the console:
The Content-Security-Policy directive 'worker-src' is implemented behind a flag which is currently disabled.
I'm testing using dropbox@2.5.7, electron@1.7.7 on OS X.
I found a similar question, but it seems to use a different version of Electron and has a different error message:
Dropbox oauth view is not rendering properly
Update:
The Content-Security-Policy
message seems to be related to the Chrome version. The worker-src
directive was introduced in Chrome 59 and electron@1.7.7 is shipped with Chrome 58.
https://www.chromestatus.com/feature/5922594955984896
I've tested with electron@1.8.0 that comes with Chrome 59, and the console messages are gone. But the problem with the auth page remains.
This happens because
BrowserWindow
has thenodeIntergration
flag enabled by default. And this conflicts with theRequireJS
implementation with whichDropbox
was bundled.So the solution would be to disable
nodeIntergration
when creating the browser window:Here's a small demo project: https://github.com/kenjiru/electron-dropbox-sample-app