How to pass parameters from main process to render processes in Electron

前端 未结 7 791
隐瞒了意图╮
隐瞒了意图╮ 2021-02-13 02:30

I have an Electron app that can open different windows.

On app launch the app open a set of window(s) (that load the same HTML and JS files) but with params to change ea

相关标签:
7条回答
  • 2021-02-13 02:58

    Unfortunately, it seems pretty complicated. You probably won't be able to add variables to .html you render in electron in a nice way.

    Of course - you can use url but it slows down booting very much (vy seconds) or you can execute Javascript in BrowserWindo, which also slows boot down.

    The only way is the IPC and leaving javascript .html agnostic to variables from main process. Very sad though..

    0 讨论(0)
提交回复
热议问题