BrowserWindow

Constructors

Link copied to clipboard
constructor(options: BrowserWindowConstructorOptions = definedExternally)

BrowserWindow

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

A string property that defines an alternative title provided only to accessibility tools such as screen readers. This string is not directly visible to users.

Link copied to clipboard

A boolean property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single Alt key.

Link copied to clipboard

A boolean property that determines whether the window can be manually closed by user.

Link copied to clipboard

A boolean property that specifies whether the window’s document has been edited.

Link copied to clipboard

A boolean property that determines whether the window is excluded from the application’s Windows menu. false by default.

Link copied to clipboard

A boolean property that determines whether the window is focusable.

Link copied to clipboard

A boolean property that determines whether the window is in fullscreen mode.

Link copied to clipboard

A boolean property that determines whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

Link copied to clipboard
val id: Double

A Integer property representing the unique ID of the window. Each ID is unique among all BrowserWindow instances of the entire Electron application.

Link copied to clipboard

A boolean property that determines whether the window is in kiosk mode.

Link copied to clipboard

A boolean property that determines whether the window can be manually maximized by user.

Link copied to clipboard

A boolean property that determines whether the menu bar should be visible.

Link copied to clipboard

A boolean property that determines whether the window can be manually minimized by user.

Link copied to clipboard

A boolean property that determines Whether the window can be moved by user.

Link copied to clipboard

A string property that determines the pathname of the file the window represents, and the icon of the file will show in window's title bar.

Link copied to clipboard

A boolean property that determines whether the window can be manually resized by user.

Link copied to clipboard

A boolean property that determines whether the window has a shadow.

Link copied to clipboard

A boolean property that determines whether the window is in simple (pre-Lion) fullscreen mode.

Link copied to clipboard

A string (optional) property that is equal to the tabbingIdentifier passed to the BrowserWindow constructor or undefined if none was set.

Link copied to clipboard

A string property that determines the title of the native window.

Link copied to clipboard

A boolean property that determines whether the window is visible on all workspaces.

Link copied to clipboard

A WebContents object this window owns. All web page related events and operations will be done via it.

Functions

Link copied to clipboard
fun addBrowserView(browserView: BrowserView)

Replacement API for setBrowserView supporting work with multi browser views.

Link copied to clipboard
fun addListener(event: BrowserWindowEvent.ALWAYS_ON_TOP_CHANGED, listener: (event: Event<*>, isAlwaysOnTop: Boolean) -> Unit)
fun addListener(event: BrowserWindowEvent.APP_COMMAND, listener: (event: Event<*>, command: String) -> Unit)
fun addListener(event: BrowserWindowEvent.CLOSE, listener: (event: Event<*>) -> Unit)
fun addListener(event: BrowserWindowEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun addListener(event: BrowserWindowEvent.ROTATE_GESTURE, listener: (event: Event<*>, rotation: Double) -> Unit)
fun addListener(event: BrowserWindowEvent.SWIPE, listener: (event: Event<*>, direction: String) -> Unit)
fun addListener(event: BrowserWindowEvent.SYSTEM_CONTEXT_MENU, listener: (event: Event<*>, point: Point) -> Unit)
fun addListener(event: BrowserWindowEvent.WILL_MOVE, listener: (event: Event<*>, newBounds: Rectangle) -> Unit)
fun addListener(event: BrowserWindowEvent.WILL_RESIZE, listener: (event: Event<*>, newBounds: Rectangle, details: WillResizeDetails) -> Unit)
Link copied to clipboard
fun addTabbedWindow(browserWindow: BrowserWindow)

Adds a window as a tab on this window, after the tab for the window instance.

Link copied to clipboard
fun blur()

Removes focus from the window.

Link copied to clipboard
Link copied to clipboard
fun capturePage(rect: Rectangle = definedExternally, opts: Opts = definedExternally): Promise<NativeImage>

Resolves with a NativeImage

Link copied to clipboard
fun center()

Moves window to the center of the screen.

Link copied to clipboard
fun close()

Try to close the window. This has the same effect as a user manually clicking the close button of the window. The web page may cancel the close though. See the close event.

Link copied to clipboard

Closes the currently open Quick Look panel.

Link copied to clipboard
fun destroy()

Force closing the window, the unload and beforeunload event won't be emitted for the web page, and close event will also not be emitted for this window, but it guarantees the closed event will be emitted.

Link copied to clipboard
Link copied to clipboard
fun flashFrame(flag: Boolean)

Starts or stops flashing the window to attract user's attention.

Link copied to clipboard
fun focus()

Focuses on the window.

Link copied to clipboard
Link copied to clipboard

Gets the background color of the window in Hex (#RRGGBB) format.

Link copied to clipboard

The bounds of the window as Object.

Link copied to clipboard

The BrowserView attached to win. Returns null if one is not attached. Throws an error if multiple BrowserViews are attached.

Link copied to clipboard

a sorted by z-index array of all BrowserViews that have been attached with addBrowserView or setBrowserView. The top-most BrowserView is the last element of the array.

Link copied to clipboard

All child windows.

Link copied to clipboard

The bounds of the window's client area as Object.

Link copied to clipboard

Contains the window's client area's width and height.

Link copied to clipboard

Contains the window's maximum width and height.

Link copied to clipboard
Link copied to clipboard

Window id in the format of DesktopCapturerSource's id. For example "window:1324:0".

Link copied to clipboard

Contains the window's minimum width and height.

Link copied to clipboard

The platform-specific handle of the window.

Link copied to clipboard

Contains the window bounds of the normal state

Link copied to clipboard

between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns

Link copied to clipboard

The parent window or null if there is no parent.

Link copied to clipboard

Contains the window's current position.

Link copied to clipboard

The pathname of the file the window represents.

Link copied to clipboard

Contains the window's width and height.

Link copied to clipboard

The title of the native window.

Link copied to clipboard

The custom position for the traffic light buttons in frameless window, null will be returned when there is no custom position.

Link copied to clipboard

Whether the window has a shadow.

Link copied to clipboard
fun hide()

Hides the window.

Link copied to clipboard
fun hookWindowMessage(message: Double, callback: (wParam: Buffer, lParam: Buffer) -> Unit)

Hooks a windows message. The callback is called when the message is received in the WndProc.

Link copied to clipboard

Invalidates the window shadow so that it is recomputed based on the current window shape.

Link copied to clipboard

Whether the window is always on top of other windows.

Link copied to clipboard

Whether the window can be manually closed by user.

Link copied to clipboard

Whether the window is destroyed.

Link copied to clipboard

Whether the window's document has been edited.

Link copied to clipboard

whether the window is enabled.

Link copied to clipboard

Whether the window can be focused.

Link copied to clipboard

Whether the window is focused.

Link copied to clipboard

Whether the window is in fullscreen mode.

Link copied to clipboard

Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

Link copied to clipboard

Whether the window will be hidden when the user toggles into mission control.

Link copied to clipboard

Whether the window is in kiosk mode.

Link copied to clipboard

Whether the window can be manually maximized by user.

Link copied to clipboard

Whether the window is maximized.

Link copied to clipboard

Whether menu bar automatically hides itself.

Link copied to clipboard

Whether the menu bar is visible.

Link copied to clipboard

Whether the window can be manually minimized by the user.

Link copied to clipboard

Whether the window is minimized.

Link copied to clipboard

Whether current window is a modal window.

Link copied to clipboard

Whether the window can be moved by user.

Link copied to clipboard

Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).

Link copied to clipboard

Whether the window can be manually resized by the user.

Link copied to clipboard

Whether the window is in simple (pre-Lion) fullscreen mode.

Link copied to clipboard

Whether the window is in Windows 10 tablet mode.

Link copied to clipboard

Whether the window is visible to the user in the foreground of the app.

Link copied to clipboard

Whether the window is visible on all workspaces.

Link copied to clipboard

true or false depending on whether the message is hooked.

Link copied to clipboard
fun loadFile(filePath: String, options: LoadFileOptions = definedExternally): Promise<Void>

the promise will resolve when the page has finished loading (see did-finish-load), and rejects if the page fails to load (see did-fail-load).

Link copied to clipboard
fun loadURL(url: String, options: LoadURLOptions = definedExternally): Promise<Void>

the promise will resolve when the page has finished loading (see did-finish-load), and rejects if the page fails to load (see did-fail-load).

Link copied to clipboard
fun maximize()

Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.

Link copied to clipboard

Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.

Link copied to clipboard
fun minimize()

Minimizes the window. On some platforms the minimized window will be shown in the Dock.

Link copied to clipboard
fun moveAbove(mediaSourceId: String)

Moves window above the source window in the sense of z-order. If the mediaSourceId is not of type window or if the window does not exist then this method throws an error.

Link copied to clipboard

Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.

Link copied to clipboard
fun moveTop()

Moves window to top(z-order) regardless of focus

Link copied to clipboard
fun off(event: BrowserWindowEvent.ALWAYS_ON_TOP_CHANGED, listener: (event: Event<*>, isAlwaysOnTop: Boolean) -> Unit)
fun off(event: BrowserWindowEvent.APP_COMMAND, listener: (event: Event<*>, command: String) -> Unit)
fun off(event: BrowserWindowEvent.BLUR, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.CLOSE, listener: (event: Event<*>) -> Unit)
fun off(event: BrowserWindowEvent.CLOSED, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.FOCUS, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.HIDE, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.MOVE, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.MOVED, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun off(event: BrowserWindowEvent.RESIZE, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.ROTATE_GESTURE, listener: (event: Event<*>, rotation: Double) -> Unit)
fun off(event: BrowserWindowEvent.SHOW, listener: Function<Unit>)
fun off(event: BrowserWindowEvent.SWIPE, listener: (event: Event<*>, direction: String) -> Unit)
fun off(event: BrowserWindowEvent.SYSTEM_CONTEXT_MENU, listener: (event: Event<*>, point: Point) -> Unit)
fun off(event: BrowserWindowEvent.WILL_MOVE, listener: (event: Event<*>, newBounds: Rectangle) -> Unit)
fun off(event: BrowserWindowEvent.WILL_RESIZE, listener: (event: Event<*>, newBounds: Rectangle, details: WillResizeDetails) -> Unit)
Link copied to clipboard
fun on(event: BrowserWindowEvent.ALWAYS_ON_TOP_CHANGED, listener: (event: Event<*>, isAlwaysOnTop: Boolean) -> Unit)

Emitted when the window is set or unset to show always on top of other windows.

fun on(event: BrowserWindowEvent.APP_COMMAND, listener: (event: Event<*>, command: String) -> Unit)

Emitted when an App Command is invoked. These are typically related to keyboard media keys or browser commands, as well as the "Back" button built into some mice on Windows.

fun on(event: BrowserWindowEvent.BLUR, listener: Function<Unit>)

Emitted when the window loses focus.

fun on(event: BrowserWindowEvent.CLOSE, listener: (event: Event<*>) -> Unit)

Emitted when the window is going to be closed. It's emitted before the beforeunload and unload event of the DOM. Calling event.preventDefault() will cancel the close.

fun on(event: BrowserWindowEvent.CLOSED, listener: Function<Unit>)

Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more.

Emitted when the window enters a full-screen state.

Emitted when the window enters a full-screen state triggered by HTML API.

fun on(event: BrowserWindowEvent.FOCUS, listener: Function<Unit>)

Emitted when the window gains focus.

fun on(event: BrowserWindowEvent.HIDE, listener: Function<Unit>)

Emitted when the window is hidden.

Emitted when the window leaves a full-screen state.

Emitted when the window leaves a full-screen state triggered by HTML API.

Emitted when window is maximized.

Emitted when the window is minimized.

fun on(event: BrowserWindowEvent.MOVE, listener: Function<Unit>)

Emitted when the window is being moved to a new position.

fun on(event: BrowserWindowEvent.MOVED, listener: Function<Unit>)

Emitted once when the window is moved to a new position.

Emitted when the native new tab button is clicked.

fun on(event: BrowserWindowEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)

Emitted when the document changed its title, calling event.preventDefault() will prevent the native window's title from changing. explicitSet is false when title is synthesized from file URL.

Emitted when the web page has been rendered (while not being shown) and window can be displayed without a visual flash.

fun on(event: BrowserWindowEvent.RESIZE, listener: Function<Unit>)

Emitted after the window has been resized.

fun on(event: BrowserWindowEvent.RESIZED, listener: Function<Unit>)

Emitted once when the window has finished being resized.

Emitted when the unresponsive web page becomes responsive again.

fun on(event: BrowserWindowEvent.RESTORE, listener: Function<Unit>)

Emitted when the window is restored from a minimized state.

fun on(event: BrowserWindowEvent.ROTATE_GESTURE, listener: (event: Event<*>, rotation: Double) -> Unit)

Emitted on trackpad rotation gesture. Continually emitted until rotation gesture is ended. The rotation value on each emission is the angle in degrees rotated since the last emission. The last emitted event upon a rotation gesture will always be of value 0. Counter-clockwise rotation values are positive, while clockwise ones are negative.

Emitted when window session is going to end due to force shutdown or machine restart or session log off.

Emitted when the window opens a sheet.

Emitted when the window has closed a sheet.

fun on(event: BrowserWindowEvent.SHOW, listener: Function<Unit>)

Emitted when the window is shown.

fun on(event: BrowserWindowEvent.SWIPE, listener: (event: Event<*>, direction: String) -> Unit)

Emitted on 3-finger swipe. Possible directions are up, right, down, left.

fun on(event: BrowserWindowEvent.SYSTEM_CONTEXT_MENU, listener: (event: Event<*>, point: Point) -> Unit)

Emitted when the system context menu is triggered on the window, this is normally only triggered when the user right clicks on the non-client area of your window. This is the window titlebar or any area you have declared as -webkit-app-region: drag in a frameless window.

Emitted when the window exits from a maximized state.

Emitted when the web page becomes unresponsive.

fun on(event: BrowserWindowEvent.WILL_MOVE, listener: (event: Event<*>, newBounds: Rectangle) -> Unit)

Emitted before the window is moved. On Windows, calling event.preventDefault() will prevent the window from being moved.

fun on(event: BrowserWindowEvent.WILL_RESIZE, listener: (event: Event<*>, newBounds: Rectangle, details: WillResizeDetails) -> Unit)

Emitted before the window is resized. Calling event.preventDefault() will prevent the window from being resized.

Link copied to clipboard
fun once(event: BrowserWindowEvent.ALWAYS_ON_TOP_CHANGED, listener: (event: Event<*>, isAlwaysOnTop: Boolean) -> Unit)
fun once(event: BrowserWindowEvent.APP_COMMAND, listener: (event: Event<*>, command: String) -> Unit)
fun once(event: BrowserWindowEvent.BLUR, listener: Function<Unit>)
fun once(event: BrowserWindowEvent.CLOSE, listener: (event: Event<*>) -> Unit)
fun once(event: BrowserWindowEvent.FOCUS, listener: Function<Unit>)
fun once(event: BrowserWindowEvent.HIDE, listener: Function<Unit>)
fun once(event: BrowserWindowEvent.MOVE, listener: Function<Unit>)
fun once(event: BrowserWindowEvent.MOVED, listener: Function<Unit>)
fun once(event: BrowserWindowEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun once(event: BrowserWindowEvent.ROTATE_GESTURE, listener: (event: Event<*>, rotation: Double) -> Unit)
fun once(event: BrowserWindowEvent.SHOW, listener: Function<Unit>)
fun once(event: BrowserWindowEvent.SWIPE, listener: (event: Event<*>, direction: String) -> Unit)
fun once(event: BrowserWindowEvent.SYSTEM_CONTEXT_MENU, listener: (event: Event<*>, point: Point) -> Unit)
fun once(event: BrowserWindowEvent.WILL_MOVE, listener: (event: Event<*>, newBounds: Rectangle) -> Unit)
fun once(event: BrowserWindowEvent.WILL_RESIZE, listener: (event: Event<*>, newBounds: Rectangle, details: WillResizeDetails) -> Unit)
Link copied to clipboard
fun previewFile(path: String, displayName: String = definedExternally)

Uses Quick Look to preview a file at a given path.

Link copied to clipboard
fun reload()

Same as webContents.reload.

Link copied to clipboard
fun removeBrowserView(browserView: BrowserView)
Link copied to clipboard
fun removeListener(event: BrowserWindowEvent.ALWAYS_ON_TOP_CHANGED, listener: (event: Event<*>, isAlwaysOnTop: Boolean) -> Unit)
fun removeListener(event: BrowserWindowEvent.APP_COMMAND, listener: (event: Event<*>, command: String) -> Unit)
fun removeListener(event: BrowserWindowEvent.CLOSE, listener: (event: Event<*>) -> Unit)
fun removeListener(event: BrowserWindowEvent.PAGE_TITLE_UPDATED, listener: (event: Event<*>, title: String, explicitSet: Boolean) -> Unit)
fun removeListener(event: BrowserWindowEvent.ROTATE_GESTURE, listener: (event: Event<*>, rotation: Double) -> Unit)
fun removeListener(event: BrowserWindowEvent.SWIPE, listener: (event: Event<*>, direction: String) -> Unit)
fun removeListener(event: BrowserWindowEvent.SYSTEM_CONTEXT_MENU, listener: (event: Event<*>, point: Point) -> Unit)
fun removeListener(event: BrowserWindowEvent.WILL_MOVE, listener: (event: Event<*>, newBounds: Rectangle) -> Unit)
fun removeListener(event: BrowserWindowEvent.WILL_RESIZE, listener: (event: Event<*>, newBounds: Rectangle, details: WillResizeDetails) -> Unit)
Link copied to clipboard

Remove the window's menu bar.

Link copied to clipboard
fun restore()

Restores the window from minimized state to its previous state.

Link copied to clipboard

Selects the next tab when native tabs are enabled and there are other tabs in the window.

Link copied to clipboard

Selects the previous tab when native tabs are enabled and there are other tabs in the window.

Link copied to clipboard
fun setAlwaysOnTop(flag: Boolean, level: BrowserWindowSetAlwaysOnTopLevel = definedExternally, relativeLevel: Double = definedExternally)

Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.

Link copied to clipboard

Sets the properties for the window's taskbar button.

Link copied to clipboard
fun setAspectRatio(aspectRatio: Double, extraSize: Size = definedExternally)

This will make a window maintain an aspect ratio. The extra size allows a developer to have space, specified in pixels, not included within the aspect ratio calculations. This API already takes into account the difference between a window's size and its content size.

Link copied to clipboard
fun setAutoHideCursor(autoHide: Boolean)

Controls whether to hide cursor when typing.

Link copied to clipboard

Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single Alt key.

Link copied to clipboard
fun setBackgroundColor(backgroundColor: String)

Examples of valid backgroundColor values:

Link copied to clipboard

This method sets the browser window's system-drawn background material, including behind the non-client area.

Link copied to clipboard
fun setBounds(bounds: Rectangle, animate: Boolean = definedExternally)

Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.

Link copied to clipboard
fun setBrowserView(browserView: BrowserView?)
Link copied to clipboard
fun setClosable(closable: Boolean)

Sets whether the window can be manually closed by user. On Linux does nothing.

Link copied to clipboard
fun setContentBounds(bounds: Rectangle, animate: Boolean = definedExternally)

Resizes and moves the window's client area (e.g. the web page) to the supplied bounds.

Link copied to clipboard

Prevents the window contents from being captured by other apps.

Link copied to clipboard
fun setContentSize(width: Double, height: Double, animate: Boolean = definedExternally)

Resizes the window's client area (e.g. the web page) to width and height.

Link copied to clipboard

Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to true.

Link copied to clipboard
fun setEnabled(enable: Boolean)

Disable or enable the window.

Link copied to clipboard
fun setFocusable(focusable: Boolean)

Changes whether the window can be focused.

Link copied to clipboard

Sets whether the window should be in fullscreen mode.

Link copied to clipboard
fun setFullScreenable(fullscreenable: Boolean)

Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

Link copied to clipboard
fun setHasShadow(hasShadow: Boolean)

Sets whether the window should have a shadow.

Link copied to clipboard

Sets whether the window will be hidden when the user toggles into mission control.

Link copied to clipboard
fun setIcon(icon: NativeImage)
fun setIcon(icon: String)

Changes window icon.

Link copied to clipboard
fun setIgnoreMouseEvents(ignore: Boolean, options: IgnoreMouseEventsOptions = definedExternally)

Makes the window ignore all mouse events.

Link copied to clipboard
fun setKiosk(flag: Boolean)

Enters or leaves kiosk mode.

Link copied to clipboard
fun setMaximizable(maximizable: Boolean)

Sets whether the window can be manually maximized by user. On Linux does nothing.

Link copied to clipboard
fun setMaximumSize(width: Double, height: Double)

Sets the maximum size of window to width and height.

Link copied to clipboard
Link copied to clipboard
fun setMenu(menu: Menu?)

Sets the menu as the window's menu bar.

Link copied to clipboard

Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single Alt key.

Link copied to clipboard
fun setMinimizable(minimizable: Boolean)

Sets whether the window can be manually minimized by user. On Linux does nothing.

Link copied to clipboard
fun setMinimumSize(width: Double, height: Double)

Sets the minimum size of window to width and height.

Link copied to clipboard
fun setMovable(movable: Boolean)

Sets whether the window can be moved by user. On Linux does nothing.

Link copied to clipboard
fun setOpacity(opacity: Double)

Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the 0, 1 range.

Link copied to clipboard
fun setOverlayIcon(overlay: NativeImage?, description: String)

Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user.

Link copied to clipboard

Sets parent as current window's parent window, passing null will turn current window into a top-level window.

Link copied to clipboard
fun setPosition(x: Double, y: Double, animate: Boolean = definedExternally)

Moves window to x and y.

Link copied to clipboard
fun setProgressBar(progress: Double, options: ProgressBarOptions = definedExternally)

Sets progress value in progress bar. Valid range is 0, 1.0.

Link copied to clipboard

Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar.

Link copied to clipboard
fun setResizable(resizable: Boolean)

Sets whether the window can be manually resized by the user.

Link copied to clipboard

Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window.

Link copied to clipboard
fun setSheetOffset(offsetY: Double, offsetX: Double = definedExternally)

Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. For example:

Link copied to clipboard

Enters or leaves simple fullscreen mode.

Link copied to clipboard
fun setSize(width: Double, height: Double, animate: Boolean = definedExternally)

Resizes the window to width and height. If width or height are below any set minimum size constraints the window will snap to its minimum size.

Link copied to clipboard

Makes the window not show in the taskbar.

Link copied to clipboard

Whether the buttons were added successfully

Link copied to clipboard

Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: { x: 0, y: 0, width: 0, height: 0 }.

Link copied to clipboard

Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar.

Link copied to clipboard
fun setTitle(title: String)

Changes the title of native window to title.

Link copied to clipboard

On a Window with Window Controls Overlay already enabled, this method updates the style of the title bar overlay.

Link copied to clipboard
fun setTopBrowserView(browserView: BrowserView)

Raises browserView above other BrowserViews attached to win. Throws an error if browserView is not attached to win.

Link copied to clipboard
fun setTouchBar(touchBar: TouchBar?)

Sets the touchBar layout for the current window. Specifying null or undefined clears the touch bar. This method only has an effect if the machine has a touch bar.

Link copied to clipboard

Adds a vibrancy effect to the browser window. Passing null or an empty string will remove the vibrancy effect on the window.

Link copied to clipboard
fun setVisibleOnAllWorkspaces(visible: Boolean, options: VisibleOnAllWorkspacesOptions = definedExternally)

Sets whether the window should be visible on all workspaces.

Link copied to clipboard

Set a custom position for the traffic light buttons in frameless window. Passing null will reset the position to default.

Link copied to clipboard

Sets whether the window traffic light buttons should be visible.

Link copied to clipboard
fun show()

Shows and gives focus to the window.

Link copied to clipboard

Shows or hides the tab overview when native tabs are enabled.

Link copied to clipboard

Same as webContents.showDefinitionForSelection().

Link copied to clipboard

Shows the window but doesn't focus on it.

Link copied to clipboard

Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.

Link copied to clipboard

Unhooks all of the window messages.

Link copied to clipboard

Unhook the window message.

Link copied to clipboard

Unmaximizes the window.