2017-07-07 874 views
1

我在我的Electron桌面应用程序中使用Facebook身份验证。我将FB auth视图加载到Electron BrowserWindow中。当BrowserWindow第一负载,我得到的错误:Electron BrowserWindow Facebook登录无法设置Cookie

Uncaught DOMException: Failed to set the 'cookie' property on 'Document': Cookies are disabled inside 'data:' URLs. 

当我尝试登录,我得到的错误:

Uncaught DOMException: Failed to read the 'cookie' property from 'Document': Cookies are disabled inside 'data:' URLs. 

这里是我正在加载我的原始HTML为Facebook查看(data ['_ body'])到BrowserWindow中:

let windowProperties = { 
      height: 900, 
      width: 1200, 
      webPreferences: { 
       webSecurity: false, 
       nodeIntegration: false 
      } 
      }; 
      let win = new electron.remote.BrowserWindow(windowProperties) 
      win.loadURL('data:text/html,' + encodeURIComponent(data["_body"])); 

任何帮助将不胜感激!

回答