Reputation: 65
I recently started making an app on Electron, I wanted to make the window responsive, for example, if I open app on different screens it should open in full-size according to the screen size.
my code:
app.on('ready', () => {
const htmlPath = path.join('src', 'html/login.html')
mainWindow1 = new BrowserWindow({ width: 1000 , height: 1000})
mainWindow1.loadFile(htmlPath)
})
Please help me with this.
Upvotes: 2
Views: 3051
Reputation: 2948
After creating your BrowserWindow
you should call maximize()
mainWindow1 = new BrowserWindow();
mainWindow1.loadFile(htmlPath);
mainWindow1.maximize();
https://electronjs.org/docs/api/browser-window#winmaximize
Upvotes: 1