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
We can inject Javascript code execution (on window did-finish-load
event) and trigger react re-rendering with correct redux state portion. But it requires additional lifecycle step in rendered process.
Using hash or query in "local filepath" sounds a little bit weird but in my case it take sense since the hash describe the redux store branch to take in consideration in this window (file://which-code-to-load#which-content
).
So even if i'm not totally at ease with this approach right now I'll take the second option.
It's a shame that the API doesn't provide any way to declare global vars from main process on window opening. I'll post a feature request.