Skip to content

BrowserWindowConstructorOptions

Unofficial

Options for creating a new BrowserWindow.

Import:

import type { BrowserWindowConstructorOptions } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface BrowserWindowConstructorOptions

Properties

PropertyTypeDescription
acceptFirstMouse?booleanWhether clicking an inactive window will also click through to the web contents. This option is not configurable on platforms other than macOS.
alwaysOnTop?booleanWhether the window should always stay on top of other windows.
autoHideMenuBar?booleanAuto hide the menu bar unless the Alt key is pressed.
backgroundColor?stringThe 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.
center?booleanShow window in the center of the screen.
closable?booleanWhether window is closable. This is not implemented on Linux.
darkTheme?booleanForces using dark theme for the window, only works on some GTK+3 desktop environments.
disableAutoHideCursor?booleanWhether to hide cursor when typing.
enableLargerThanScreen?booleanEnable the window to be resized larger than screen. Only relevant for macOS, as other OSes allow larger-than-screen windows by default.
focusable?booleanWhether the window can be focused. On Windows setting focusable: false also implies setting skipTaskbar: true. On Linux setting focusable: false makes the window stop interacting with wm.
frame?booleanSpecify false to create a frameless window.
fullscreen?booleanWhether the window should show in fullscreen. When explicitly set to false the fullscreen button will be hidden or disabled on macOS.
fullscreenable?booleanWhether the window can be put into fullscreen mode. On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window.
fullscreenWindowTitle?booleanShows the title in the title bar in full screen mode on macOS for hiddenInset titleBarStyle.
hasShadow?booleanWhether window should have a shadow.
height?numberWindow's height in pixels.
icon?ElectronNativeImage | stringThe window icon. On Windows it is recommended to use ICO icons to get best visual effects; it can also be left undefined so the executable's icon will be used.
kiosk?booleanWhether the window is in kiosk mode.
maxHeight?numberWindow's maximum height. Default is no limit.
maximizable?booleanWhether window is maximizable. This is not implemented on Linux.
maxWidth?numberWindow's maximum width. Default is no limit.
minHeight?numberWindow's minimum height.
minimizable?booleanWhether window is minimizable. This is not implemented on Linux.
minWidth?numberWindow's minimum width.
modal?booleanWhether this is a modal window. This only works when the window is a child window.
movable?booleanWhether window is movable. This is not implemented on Linux.
opacity?numberSet the initial opacity of the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
paintWhenInitiallyHidden?booleanWhether the renderer should be active when show is false and it has just been created. In order for document.visibilityState to work correctly on first load with show: false this should be set to false.
parent?ElectronBrowserWindowSpecify parent window.
resizable?booleanWhether window is resizable.
roundedCorners?booleanWhether frameless window should have rounded corners on macOS.
show?booleanWhether window should be shown when created.
simpleFullscreen?booleanUse pre-Lion fullscreen on macOS.
skipTaskbar?booleanWhether to show the window in taskbar.
tabbingIdentifier?stringTab group name, allows opening the window as a native tab on macOS 10.12+. Windows with the same tabbing identifier will be grouped together.
thickFrame?booleanUse WS_THICKFRAME style for frameless windows on Windows, which adds standard window frame. Setting it to false will remove window shadow and window animations.
title?stringDefault window title. If the HTML tag <title> is defined in the HTML file loaded by loadURL(), this property will be ignored.
titleBarOverlay?boolean | ElectronTitleBarOverlayWhen using a frameless window in conjunction with win.setWindowButtonVisibility(true) on macOS or using a titleBarStyle so that the standard window controls are visible, this property enables the Window Controls Overlay JavaScript APIs and CSS Environment Variables. Specifying true will result in an overlay with default system colors.
titleBarStyle?'customButtonsOnHover' | 'default' | 'hidden' | 'hiddenInset'The style of window title bar (macOS and Windows).
trafficLightPosition?ElectronPointSet a custom position for the traffic light buttons in frameless windows.
transparent?booleanMakes the window transparent. On Windows, does not work unless the window is frameless.
type?stringThe type of window, default is normal window.
useContentSize?booleanThe width and height would be used as web page's size, which means the actual window's size will include window frame's size and be slightly larger.
vibrancy?'appearance-based' | 'content' | 'dark' | 'fullscreen-ui' | 'header' | 'hud' | 'light' | 'medium-light' | 'menu' | 'popover' | 'selection' | 'sheet' | 'sidebar' | 'titlebar' | 'tooltip' | 'ultra-dark' | 'under-page' | 'under-window' | 'window'Add a type of vibrancy effect to the window, only on macOS. Note that appearance-based, light, dark, medium-light, and ultra-dark are deprecated and have been removed in macOS Catalina (10.15).
visualEffectState?'active' | 'followWindow' | 'inactive'Specify how the material appearance should reflect window activity state on macOS. Must be used with the vibrancy property.
webPreferences?WebPreferencesSettings of web page's features.
width?numberWindow's width in pixels.
x?numberWindow's left offset from screen (required if y is used). Default is to center the window.
y?numberWindow's top offset from screen (required if x is used). Default is to center the window.
zoomToPageWidth?booleanControls the behavior on macOS when option-clicking the green stoplight button on the toolbar or by 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.

Links to this page: