0
嘗試使用ember-electron
構建Electron應用,並試圖使用emberfire
與Firebase進行通信。無法從電子應用內訪問Firebase
XMLHttpRequest cannot load https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyBYyuJ-1E3ufujlzdKhj8gE9I6QH8TreJE. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'serve://dist' is therefore not allowed access. The response had HTTP status code 404.
這是一個已知的問題還是沒有人知道解決的辦法:一切都與ember s
一個web應用程序運行,但作爲電子應用推出時,我什麼也沒得到,但象這樣的錯誤,當運行正常?遺憾的是,不能簡單地將serve://dist
添加到授權域名列表中,因爲Google並不認爲它是有效的域名。
更新:我還是很想知道如果任何人有一個可能的解決方法,但我發現了一個名爲Nativefier(https://github.com/jiahaog/nativefier)工具,它適合我的目的。由於我同時開發Web應用程序和桌面應用程序,一旦託管了Web應用程序,就可以使用本地應用程序構建桌面應用程序。