2017-07-07 139 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"])); 

任何幫助將不勝感激!

回答