Skip to content

BrowserWindowConstructorOptions

Unofficial

Options for creating a new BrowserWindow.

Import:

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

Signature:

export interface BrowserWindowConstructorOptions

Properties

Property Type Description
acceptFirstMouse? boolean Whether clicking an inactive window will also click through to the web contents. This option is not configurable on platforms other than macOS.
alwaysOnTop? boolean Whether the window should always stay on top of other windows.
autoHideMenuBar? boolean Auto hide the menu bar unless the Alt key is pressed.
backgroundColor? string 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.
center? boolean Show window in the center of the screen.
closable? boolean Whether window is closable. This is not implemented on Linux.
darkTheme? boolean Forces using dark theme for the window, only works on some GTK+3 desktop environments.
disableAutoHideCursor? boolean Whether to hide cursor when typing.
enableLargerThanScreen? boolean Enable the window to be resized larger than screen. Only relevant for macOS, as other OSes allow larger-than-screen windows by default.
focusable? boolean Whether 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? boolean Specify false to create a frameless window.
fullscreen? boolean Whether the window should show in fullscreen. When explicitly set to false the fullscreen button will be hidden or disabled on macOS.
fullscreenable? boolean Whether 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? boolean Shows the title in the title bar in full screen mode on macOS for hiddenInset titleBarStyle.
hasShadow? boolean Whether window should have a shadow.
height? number Window's height in pixels.
icon? ElectronNativeImage | string The 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? boolean Whether the window is in kiosk mode.
maxHeight? number Window's maximum height. Default is no limit.
maximizable? boolean Whether window is maximizable. This is not implemented on Linux.
maxWidth? number Window's maximum width. Default is no limit.
minHeight? number Window's minimum height.
minimizable? boolean Whether window is minimizable. This is not implemented on Linux.
minWidth? number Window's minimum width.
modal? boolean Whether this is a modal window. This only works when the window is a child window.
movable? boolean Whether window is movable. This is not implemented on Linux.
opacity? number Set 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? boolean Whether 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? ElectronBrowserWindow Specify parent window.
resizable? boolean Whether window is resizable.
roundedCorners? boolean Whether frameless window should have rounded corners on macOS.
show? boolean Whether window should be shown when created.
simpleFullscreen? boolean Use pre-Lion fullscreen on macOS.
skipTaskbar? boolean Whether to show the window in taskbar.
tabbingIdentifier? string Tab 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? boolean Use 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? string Default window title. If the HTML tag <title> is defined in the HTML file loaded by loadURL(), this property will be ignored.
titleBarOverlay? boolean | ElectronTitleBarOverlay When 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? ElectronPoint Set a custom position for the traffic light buttons in frameless windows.
transparent? boolean Makes the window transparent. On Windows, does not work unless the window is frameless.
type? string The type of window, default is normal window.
useContentSize? boolean The 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? WebPreferences Settings of web page's features.
width? number Window's width in pixels.
x? number Window's left offset from screen (required if y is used). Default is to center the window.
y? number Window's top offset from screen (required if x is used). Default is to center the window.
zoomToPageWidth? boolean Controls 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: