new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · all subjects

api modules - window

54 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

BaseWindowConstructorOptions type toolbar behavior

On Linux, the toolbar type creates a window with a toolbar appearance. On Windows, toolbar is the possible type.

BaseWindowConstructorOptions width and height defaults

The width property is an optional Integer representing the window's width in pixels with a default of 800. The height property is an optional Integer representing the window's height in pixels with a default of 600.

BaseWindowConstructorOptions x and y positioning

The x property is an optional Integer for the window's left offset from screen and is required if y is used. The y property is an optional Integer for the window's top offset from screen and is required if x is used. By default, both x and y default to centering the window on the screen.

BaseWindowConstructorOptions useContentSize

The useContentSize property is an optional boolean. When true, the width and height values are used as the web page's size, meaning the actual window's size will include the window frame's size and be slightly larger. Default is false.

BaseWindowConstructorOptions center

The center property is an optional boolean that shows the window in the center of the screen. Default is false.

BaseWindowConstructorOptions minimum and maximum size constraints

minWidth (optional Integer, default 0) and minHeight (optional Integer, default 0) set the window's minimum dimensions. maxWidth (optional Integer, default no limit) and maxHeight (optional Integer, default no limit) set the window's maximum dimensions. These constraints only affect user resizing; passing unconstrained sizes directly to setBounds, setSize, or the constructor will not be prevented.

BaseWindowConstructorOptions resizable

The resizable property is an optional boolean that determines whether the window is resizable. Default is true.

BaseWindowConstructorOptions movable, minimizable, maximizable, closable

movable (optional boolean, default true, macOS and Windows only) determines whether the window is movable; not implemented on Linux. minimizable (optional boolean, default true, macOS and Windows only) determines whether the window is minimizable; not implemented on Linux. maximizable (optional boolean, default true, macOS and Windows only) determines whether the window is maximizable; not implemented on Linux. closable (optional boolean, default true, macOS and Windows only) determines whether the window is closable; not implemented on Linux.

BaseWindowConstructorOptions focusable behavior

The focusable property is an optional boolean determining whether the window can be focused; default is true. On Windows, setting focusable to false also implies setting skipTaskbar to true. On Linux, setting focusable to false makes the window stop interacting with the window manager, causing the window to always stay on top in all workspaces.

BaseWindowConstructorOptions alwaysOnTop

The alwaysOnTop property is an optional boolean determining whether the window should always stay on top of other windows. Default is false. Not supported on Wayland (Linux).

BaseWindowConstructorOptions fullscreen

The fullscreen property is an optional boolean determining whether the window should show in fullscreen. When explicitly set to false, the fullscreen button will be hidden or disabled on macOS. Default is false.

BaseWindowConstructorOptions fullscreenable

The fullscreenable property is an optional boolean determining whether the window can be put into fullscreen mode. On macOS, it also determines whether the maximize/zoom button should toggle fullscreen mode or maximize the window. Default is true.

BaseWindowConstructorOptions simpleFullscreen macOS only

The simpleFullscreen property is an optional boolean (macOS only) that uses pre-Lion fullscreen on macOS. Default is false.

BaseWindowConstructorOptions skipTaskbar

The skipTaskbar property is an optional boolean (macOS and Windows only) determining whether to show the window in the taskbar. Default is false.

BaseWindowConstructorOptions hiddenInMissionControl

The hiddenInMissionControl property is an optional boolean (macOS only) determining whether the window should be hidden when the user toggles into Mission Control.

BaseWindowConstructorOptions kiosk

The kiosk property is an optional boolean determining whether the window is in kiosk mode. Default is false.

BaseWindowConstructorOptions name property

The name property is an optional string providing a unique identifier for the window, used internally by Electron to enable features such as state persistence. Each window must have a distinct name and it can only be reused after the corresponding window has been destroyed. An error is thrown if the name is already in use. This is not the visible title shown to users on the title bar.

BaseWindowConstructorOptions windowStatePersistence

The windowStatePersistence property is optional and accepts either a WindowStatePersistence object or boolean. It configures or enables the persistence of window state (position, size, maximized state, etc.) across application restarts. Has no effect if the window name property is not provided. Automatically disabled when there is no available display. This feature is marked as experimental.

BaseWindowConstructorOptions title

The title property is an optional string specifying the default window title; default is 'Electron'. If the HTML tag <title> is defined in the HTML file loaded by loadURL(), this property will be ignored.

BaseWindowConstructorOptions icon

The icon property is optional and accepts either a NativeImage or string. It sets the window icon. On Windows it is recommended to use ICO icons to get best visual effects; you can also leave it undefined so the executable's icon will be used.

BaseWindowConstructorOptions show

The show property is an optional boolean determining whether the window should be shown when created. Default is true.

BaseWindowConstructorOptions frame frameless windows

The frame property is an optional boolean. Setting it to false creates a frameless window. Default is true.

BaseWindowConstructorOptions parent and modal

The parent property is optional and accepts a BaseWindow, specifying the parent window; default is null. The modal property is an optional boolean determining whether this is a modal window; this only works when the window is a child window. Default is false.

BaseWindowConstructorOptions acceptFirstMouse

The acceptFirstMouse property is an optional boolean (macOS only) determining whether clicking an inactive window will also click through to the web contents. Default is false on macOS. This option is not configurable on other platforms.

BaseWindowConstructorOptions disableAutoHideCursor

The disableAutoHideCursor property is an optional boolean determining whether to hide the cursor when typing. Default is false.

BaseWindowConstructorOptions autoHideMenuBar

The autoHideMenuBar property is an optional boolean (Linux and Windows only) that auto hides the menu bar unless the Alt key is pressed. Default is false.

BaseWindowConstructorOptions enableLargerThanScreen

The enableLargerThanScreen property is an optional boolean (macOS only) that enables the window to be resized larger than the screen. Only relevant for macOS, as other operating systems allow larger-than-screen windows by default. Default is false.

BaseWindowConstructorOptions backgroundColor

The backgroundColor property is an optional string specifying the window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if transparent is set to true. Default is #FFF (white).

BaseWindowConstructorOptions hasShadow

The hasShadow property is an optional boolean determining whether the window should have a shadow. Default is true.

BaseWindowConstructorOptions opacity

The opacity property is an optional number (macOS and Windows only) that sets the initial opacity of the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.

BaseWindowConstructorOptions darkTheme

The darkTheme property is an optional boolean that forces using dark theme for the window; only works on some GTK+3 desktop environments. Default is false.

BaseWindowConstructorOptions transparent

The transparent property is an optional boolean that makes the window transparent. Default is false. On Windows, it does not work unless the window is frameless. When adding a View to a BaseWindow, you need to call view.setBackgroundColor with a transparent background color on that view to make its background transparent as well.

BaseWindowConstructorOptions type property

The type property is an optional string specifying the type of window; default is normal window. On Linux, possible types are desktop, dock, toolbar, splash, or notification. On macOS, possible types are desktop, textured, or panel. On Windows, the possible type is toolbar.

BaseWindowConstructorOptions type desktop behavior

The desktop type places the window at the desktop background window level. On Linux, the window will not receive focus, keyboard, or mouse events, but globalShortcut can still be used to receive input sparingly. On macOS, the desktop window will not receive focus, keyboard or mouse events, but globalShortcut can be used.

BaseWindowConstructorOptions type dock behavior Linux

On Linux, the dock type creates a dock-like window behavior.

BaseWindowConstructorOptions type splash behavior

On Linux, the splash type behaves in a specific way. It is not draggable, even if the CSS styling of the window's body contains -webkit-app-region: drag. This type is commonly used for splash screens.

BaseWindowConstructorOptions type notification behavior

On Linux, the notification type creates a window that behaves like a system notification.

BaseWindowConstructorOptions type textured macOS deprecated

On macOS, the textured type adds a metal gradient appearance. This option is deprecated.

BaseWindowConstructorOptions type panel macOS

On macOS, the panel type enables the window to float on top of full-screened apps by adding the NSWindowStyleMaskNonactivatingPanel style mask, normally reserved for NSPanel, at runtime. Also, the window will appear on all spaces (desktops).

BaseWindowConstructorOptions visualEffectState macOS

The visualEffectState property is an optional string (macOS only) that specifies how the material appearance should reflect window activity state on macOS. Must be used with the vibrancy property. Possible values are: followWindow (default, backdrop automatically appears active when window is active and inactive when not), active (backdrop always appears active), or inactive (backdrop always appears inactive).

BaseWindowConstructorOptions titleBarStyle values

The titleBarStyle property is an optional string with default value 'default'. Possible values are: default (standard title bar for macOS or Windows), hidden (hidden title bar and full size content window; on macOS the window still has standard window controls in the top left; on Windows and Linux, when combined with titleBarOverlay: true it activates the Window Controls Overlay, otherwise no window controls shown), hiddenInset (macOS only, hidden title bar with alternative look where traffic light buttons are slightly more inset), and customButtonsOnHover (macOS only and experimental, hidden title bar and full size content window with traffic light buttons displaying on hover).

BaseWindowConstructorOptions titleBarOverlay

The titleBarOverlay property is optional and accepts either an Object or boolean. When using a frameless window with win.setWindowButtonVisibility(true) on macOS or using a titleBarStyle so standard window controls are visible, this property enables the Window Controls Overlay JavaScript APIs and CSS Environment Variables. Specifying true results in an overlay with default system colors. Default is false.

BaseWindowConstructorOptions titleBarOverlay sub-properties

titleBarOverlay color (optional String, Windows and Linux only) is the CSS color of the Window Controls Overlay when enabled; default is system color. titleBarOverlay symbolColor (optional String, Windows and Linux only) is the CSS color of the symbols on the Window Controls Overlay when enabled; default is system color. titleBarOverlay height (optional Integer) is the height of the title bar and Window Controls Overlay in pixels; default is system height.

BaseWindowConstructorOptions accentColor Windows

The accentColor property is optional (Windows only) and can be boolean or string. It sets the accent color for the window. By default, it follows user preference in System Settings. Set to false to explicitly disable, or set the color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha values will be ignored.

BaseWindowConstructorOptions trafficLightPosition macOS

The trafficLightPosition property is optional (macOS only) and accepts a Point object, allowing you to set a custom position for the traffic light buttons in frameless windows.

BaseWindowConstructorOptions roundedCorners

The roundedCorners property is an optional boolean determining whether a frameless window should have rounded corners. Default is true. On Windows versions older than Windows 11 Build 22000 this property has no effect, and frameless windows will not have rounded corners. On Linux, rounded corners are only drawn when the desktop environment supports client-side decorations.

BaseWindowConstructorOptions thickFrame Windows

The thickFrame property is an optional boolean (Windows only). Setting it to true (default) uses WS_THICKFRAME style for frameless windows on Windows, which adds the standard window frame. Setting it to false removes window shadow and window animations, and disables window resizing via dragging the window edges.

BaseWindowConstructorOptions vibrancy macOS

The vibrancy property is an optional string (macOS only) that adds a type of vibrancy effect to the window. Possible values are: appearance-based, titlebar, selection, menu, popover, sidebar, header, sheet, window, hud, fullscreen-ui, tooltip, content, under-window, or under-page.

BaseWindowConstructorOptions backgroundMaterial Windows

The backgroundMaterial property is an optional string (Windows only) that sets the window's system-drawn background material, including behind the non-client area. Possible values are: auto, none, mica, acrylic, or tabbed.

BaseWindowConstructorOptions zoomToPageWidth macOS

The zoomToPageWidth property is an optional boolean (macOS only) that controls the behavior when option-clicking the green stoplight button on the toolbar or clicking the Window > Zoom menu item. If true, the window will grow to the preferred width of the web page when zoomed; false will cause it to zoom to the width of the screen. This also affects the behavior when calling maximize() directly. Default is false.

BaseWindowConstructorOptions tabbingIdentifier macOS

The tabbingIdentifier property is an optional string (macOS only) specifying the tab group name, allowing the window to be opened as a native tab. Windows with the same tabbing identifier will be grouped together. This also adds a native new tab button to the window's tab bar and allows the app and window to receive the new-window-for-tab event.

BrowserWindowConstructorOptions extends BaseWindowConstructorOptions

BrowserWindowConstructorOptions is an object that extends BaseWindowConstructorOptions and includes additional properties for configuring a browser window.

webPreferences option in BrowserWindowConstructorOptions

webPreferences is an optional property of type WebPreferences that contains settings for the web page's features. It is used when constructing a BrowserWindow.

paintWhenInitiallyHidden option in BrowserWindowConstructorOptions

paintWhenInitiallyHidden is an optional boolean property that controls whether the renderer should be active when show is false and the window has just been created. The default value is true. Setting this to false will cause the ready-to-show event to not fire. To ensure document.visibilityState works correctly on first load with show: false, set paintWhenInitiallyHidden to false.

Give your agent this brain