Running multiple windows #41
Answered
by
alex8088
petdomaa100
asked this question in
Q&A
-
Hi. Is it possible to run multiple electron windows, all with HMR? Is there a way to set up another env variable like "ELECTRON_RENDERER_URL" for the second window? function createWindows(): void {
const win1 = new BrowserWindow({
// ...
});
const win2 = new BrowserWindow({
// ...
});
if (is.dev && process.env.ELECTRON_RENDERER_URL) {
win1.loadURL(process.env.ELECTRON_RENDERER_URL);
win2.loadURL(process.env.ELECTRON_RENDERER_URL);
} else {
win1.loadFile(path.join(__dirname, '../renderer/1.html'));
win2.loadFile(path.join(__dirname, '../renderer/2.html'));
}
} Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
alex8088
Oct 23, 2022
Replies: 2 comments 1 reply
-
e.g. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
petdomaa100
-
example: https://github.com/alex8088/electron-micro-app |
Beta Was this translation helpful? Give feedback.
1 reply
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
e.g.
process.env.ELECTRON_RENDERER_URL + 1. html