The BrowserWindow
class is used to create and manage the browser windows. We have used this class throughout this book. It provides a lot of features more than just creating a window. The window can be customized as per your requirement using this class. This class provides a rich set of methods and events; let's look at some of them here in this section.
We have just set the width and height inside the browser. However, it can accept a huge list of valid options as the constructor arguments. Some of the options are platform specific that will work only on that platform. Here are some of the important option that you can pass inside the constructor; visit the Electron documentation for a complete list of options-all the options listed here are optional:
width
: Width of the window.height
: Height of the window.x
: Left offset.y
: Top offset.maxWidth
,minWidth
: You can set these two options to set the minimum and maximum resizable width of the window.maxHeight
,maxHeight...