简体   繁体   English

Firebase 未在 Electron 主进程中定义

[英]Firebase is not defined in Electron main process

I have defined Firebase in the HTML file in Renderer process.我在 Renderer 进程的 HTML 文件中定义了 Firebase。 How can I use it in the Electron Main process files?如何在 Electron 主流程文件中使用它?

I have found a workaround, but maybe there is a better way to do it.我找到了一种解决方法,但也许有更好的方法来做到这一点。 I have used Electron's IPC (inter process communication) modules, ipcMain, ipcRenderer and webContents to communicate between the two processes, and defined and use Firebase only in one module (in my case renderer).我使用了 Electron 的 IPC(进程间通信)模块,ipcMain、ipcRenderer 和 webContents 在两个进程之间进行通信,并且仅在一个模块(在我的情况下为渲染器)中定义和使用 Firebase。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM