Skip to content

ElectronWindow

Defined in: src/obsidian/internals/ElectronWindow.d.ts:4

Extends

  • BrowserWindow

Properties

_browserViews

_browserViews: unknown

Defined in: src/obsidian/internals/ElectronWindow.d.ts:5


_events

_events: unknown

Defined in: src/obsidian/internals/ElectronWindow.d.ts:6


_eventsCount

_eventsCount: unknown

Defined in: src/obsidian/internals/ElectronWindow.d.ts:7


accessibleTitle

accessibleTitle: string

Defined in: node_modules/electron/electron.d.ts:5966

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.

Inherited from

BrowserWindow.accessibleTitle


autoHideMenuBar

autoHideMenuBar: boolean

Defined in: node_modules/electron/electron.d.ts:5975

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.

If the menu bar is already visible, setting this property to true won’t hide it immediately.

Inherited from

BrowserWindow.autoHideMenuBar


closable

closable: boolean

Defined in: node_modules/electron/electron.d.ts:5984

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

On Linux the setter is a no-op, although the getter returns true.

Platform

darwin,win32

Inherited from

BrowserWindow.closable


contentView

contentView: View

Defined in: node_modules/electron/electron.d.ts:3367

A View property for the content view of the window.

Inherited from

BrowserWindow.contentView


devToolsWebContents

devToolsWebContents: unknown

Defined in: src/obsidian/internals/ElectronWindow.d.ts:8


documentEdited

documentEdited: boolean

Defined in: node_modules/electron/electron.d.ts:5993

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

The icon in title bar will become gray when set to true.

Platform

darwin

Inherited from

BrowserWindow.documentEdited


excludedFromShownWindowsMenu

excludedFromShownWindowsMenu: boolean

Defined in: node_modules/electron/electron.d.ts:6000

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

Platform

darwin

Inherited from

BrowserWindow.excludedFromShownWindowsMenu


focusable

focusable: boolean

Defined in: node_modules/electron/electron.d.ts:6006

A boolean property that determines whether the window is focusable.

Platform

win32,darwin

Inherited from

BrowserWindow.focusable


fullScreen

fullScreen: boolean

Defined in: node_modules/electron/electron.d.ts:6010

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

Inherited from

BrowserWindow.fullScreen


fullScreenable

fullScreenable: boolean

Defined in: node_modules/electron/electron.d.ts:6015

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

Inherited from

BrowserWindow.fullScreenable


id

readonly id: number

Defined in: node_modules/electron/electron.d.ts:6021

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

Inherited from

BrowserWindow.id


kiosk

kiosk: boolean

Defined in: node_modules/electron/electron.d.ts:6025

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

Inherited from

BrowserWindow.kiosk


maximizable

maximizable: boolean

Defined in: node_modules/electron/electron.d.ts:6034

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

On Linux the setter is a no-op, although the getter returns true.

Platform

darwin,win32

Inherited from

BrowserWindow.maximizable


menuBarVisible: boolean

Defined in: node_modules/electron/electron.d.ts:6043

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

Note: If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single Alt key.

Platform

win32,linux

Inherited from

BrowserWindow.menuBarVisible


minimizable

minimizable: boolean

Defined in: node_modules/electron/electron.d.ts:6052

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

On Linux the setter is a no-op, although the getter returns true.

Platform

darwin,win32

Inherited from

BrowserWindow.minimizable


movable

movable: boolean

Defined in: node_modules/electron/electron.d.ts:6060

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

On Linux the setter is a no-op, although the getter returns true.

Platform

darwin,win32

Inherited from

BrowserWindow.movable


representedFilename

representedFilename: string

Defined in: node_modules/electron/electron.d.ts:6067

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.

Platform

darwin

Inherited from

BrowserWindow.representedFilename


resizable

resizable: boolean

Defined in: node_modules/electron/electron.d.ts:6072

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

Inherited from

BrowserWindow.resizable


shadow

shadow: boolean

Defined in: node_modules/electron/electron.d.ts:6076

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

Inherited from

BrowserWindow.shadow


simpleFullScreen

simpleFullScreen: boolean

Defined in: node_modules/electron/electron.d.ts:6081

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

Inherited from

BrowserWindow.simpleFullScreen


tabbingIdentifier?

readonly optional tabbingIdentifier: string

Defined in: node_modules/electron/electron.d.ts:6088

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

Platform

darwin

Inherited from

BrowserWindow.tabbingIdentifier


title

title: string

Defined in: node_modules/electron/electron.d.ts:6095

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

Note: The title of the web page can be different from the title of the native window.

Inherited from

BrowserWindow.title


visibleOnAllWorkspaces

visibleOnAllWorkspaces: boolean

Defined in: node_modules/electron/electron.d.ts:6104

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

Note: Always returns false on Windows.

Platform

darwin,linux

Inherited from

BrowserWindow.visibleOnAllWorkspaces


webContents

readonly webContents: WebContents

Defined in: node_modules/electron/electron.d.ts:6112

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

See the webContents documentation for its methods and events.

Inherited from

BrowserWindow.webContents

Methods

addBrowserView()

addBrowserView(browserView): void

Defined in: node_modules/electron/electron.d.ts:5019

Replacement API for setBrowserView supporting work with multi browser views.

Note The BrowserView class is deprecated, and replaced by the new WebContentsView class.

Parameters

browserView

BrowserView

Returns

void

Inherited from

BrowserWindow.addBrowserView


addListener()

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3853

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3866

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3901

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3939

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3952

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3960

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3981

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4002

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4011

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4020

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4028

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4036

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4044

Parameters
event

"enter-html-full-screen"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4052

Parameters
event

"focus"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4060

Parameters
event

"focus"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4068

Parameters
event

"hide"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4076

Parameters
event

"hide"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4084

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4092

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4100

Parameters
event

"leave-html-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4108

Parameters
event

"maximize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4116

Parameters
event

"maximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4124

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4132

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4140

Parameters
event

"move"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4148

Parameters
event

"move"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4169

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4193

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4215

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4237

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4256

Parameters
event

"page-title-updated"

listener

(event, title, explicitSet) => void

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4273

Parameters
event

"ready-to-show"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4281

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4289

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4312

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4338

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4349

Parameters
event

"responsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4357

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4365

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4391

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4422

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4447

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4470

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4492

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4514

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4536

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4558

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4569

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4577

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4607

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4642

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4683

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4730

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4749

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4757

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4765

Parameters
event

"unresponsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4800

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4846

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4904

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener

Call Signature

addListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4964

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.addListener


addTabbedWindow()

addTabbedWindow(browserWindow): void

Defined in: node_modules/electron/electron.d.ts:5025

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

Parameters

browserWindow

BrowserWindow

Returns

void

Platform

darwin

Inherited from

BrowserWindow.addTabbedWindow


blur()

blur(): void

Defined in: node_modules/electron/electron.d.ts:5029

Removes focus from the window.

Returns

void

Inherited from

BrowserWindow.blur


blurWebView()

blurWebView(): void

Defined in: node_modules/electron/electron.d.ts:5030

Returns

void

Inherited from

BrowserWindow.blurWebView


capturePage()

capturePage(rect?, opts?): Promise<NativeImage>

Defined in: node_modules/electron/electron.d.ts:5040

Resolves with a NativeImage

Captures a snapshot of the page within rect. Omitting rect will capture the whole visible page. If the page is not visible, rect may be empty. The page is considered visible when its browser window is hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that stayHidden is set to true.

Parameters

rect?

Rectangle

opts?

Opts

Returns

Promise<NativeImage>

Inherited from

BrowserWindow.capturePage


center()

center(): void

Defined in: node_modules/electron/electron.d.ts:5044

Moves window to the center of the screen.

Returns

void

Inherited from

BrowserWindow.center


close()

close(): void

Defined in: node_modules/electron/electron.d.ts:5050

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.

Returns

void

Inherited from

BrowserWindow.close


closeFilePreview()

closeFilePreview(): void

Defined in: node_modules/electron/electron.d.ts:5056

Closes the currently open Quick Look panel.

Returns

void

Platform

darwin

Inherited from

BrowserWindow.closeFilePreview


destroy()

destroy(): void

Defined in: node_modules/electron/electron.d.ts:5062

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.

Returns

void

Inherited from

BrowserWindow.destroy


emit()

emit(eventName, …args): boolean

Defined in: docs/node_modules/@types/node/events.d.ts:583

Synchronously calls each of the listeners registered for the event namedeventName, in the order they were registered, passing the supplied arguments to each.

Returns true if the event had listeners, false otherwise.

const EventEmitter = require('events');
const myEmitter = new EventEmitter();
// First listener
myEmitter.on('event', function firstListener() {
console.log('Helloooo! first listener');
});
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
});
// Third listener
myEmitter.on('event', function thirdListener(...args) {
const parameters = args.join(', ');
console.log(`event with parameters ${parameters} in third listener`);
});
console.log(myEmitter.listeners('event'));
myEmitter.emit('event', 1, 2, 3, 4, 5);
// Prints:
// [
// [Function: firstListener],
// [Function: secondListener],
// [Function: thirdListener]
// ]
// Helloooo! first listener
// event with parameters 1, 2 in second listener
// event with parameters 1, 2, 3, 4, 5 in third listener

Parameters

eventName

string | symbol

args

any[]

Returns

boolean

Since

v0.1.26

Inherited from

BrowserWindow.emit


eventNames()

eventNames(): (string | symbol)[]

Defined in: docs/node_modules/@types/node/events.d.ts:642

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

const EventEmitter = require('events');
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});
const sym = Symbol('symbol');
myEE.on(sym, () => {});
console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]

Returns

(string | symbol)[]

Since

v6.0.0

Inherited from

BrowserWindow.eventNames


flashFrame()

flashFrame(flag): void

Defined in: node_modules/electron/electron.d.ts:5066

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

Parameters

flag

boolean

Returns

void

Inherited from

BrowserWindow.flashFrame


focus()

focus(): void

Defined in: node_modules/electron/electron.d.ts:5070

Focuses on the window.

Returns

void

Inherited from

BrowserWindow.focus


focusOnWebView()

focusOnWebView(): void

Defined in: node_modules/electron/electron.d.ts:5071

Returns

void

Inherited from

BrowserWindow.focusOnWebView


getBackgroundColor()

getBackgroundColor(): string

Defined in: node_modules/electron/electron.d.ts:5080

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

See Setting backgroundColor.

Note: The alpha value is not returned alongside the red, green, and blue values.

Returns

string

Inherited from

BrowserWindow.getBackgroundColor


getBounds()

getBounds(): Rectangle

Defined in: node_modules/electron/electron.d.ts:5089

The bounds of the window as Object.

Note: On macOS, the y-coordinate value returned will be at minimum the Tray height. For example, calling win.setBounds({ x: 25, y: 20, width: 800, height: 600 }) with a tray height of 38 means that win.getBounds() will return { x: 25, y: 38, width: 800, height: 600 }.

Returns

Rectangle

Inherited from

BrowserWindow.getBounds


getBrowserView()

getBrowserView(): null | BrowserView

Defined in: node_modules/electron/electron.d.ts:5100

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

Note The BrowserView class is deprecated, and replaced by the new WebContentsView class.

Returns

null | BrowserView

Inherited from

BrowserWindow.getBrowserView


getBrowserViews()

getBrowserViews(): BrowserView[]

Defined in: node_modules/electron/electron.d.ts:5112

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.

Note The BrowserView class is deprecated, and replaced by the new WebContentsView class.

Returns

BrowserView[]

Inherited from

BrowserWindow.getBrowserViews


getChildWindows()

getChildWindows(): BrowserWindow[]

Defined in: node_modules/electron/electron.d.ts:5116

All child windows.

Returns

BrowserWindow[]

Inherited from

BrowserWindow.getChildWindows


getContentBounds()

getContentBounds(): Rectangle

Defined in: node_modules/electron/electron.d.ts:5120

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

Returns

Rectangle

Inherited from

BrowserWindow.getContentBounds


getContentSize()

getContentSize(): number[]

Defined in: node_modules/electron/electron.d.ts:5124

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

Returns

number[]

Inherited from

BrowserWindow.getContentSize


getContentView()

getContentView(): void

Defined in: node_modules/electron/electron.d.ts:2565

Returns View - The content view of the window.

Returns

void

Inherited from

BrowserWindow.getContentView


getMaximumSize()

getMaximumSize(): number[]

Defined in: node_modules/electron/electron.d.ts:5128

Contains the window’s maximum width and height.

Returns

number[]

Inherited from

BrowserWindow.getMaximumSize


getMaxListeners()

getMaxListeners(): number

Defined in: docs/node_modules/@types/node/events.d.ts:499

Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

Returns

number

Since

v1.0.0

Inherited from

BrowserWindow.getMaxListeners


getMediaSourceId()

getMediaSourceId(): string

Defined in: node_modules/electron/electron.d.ts:5138

Window id in the format of DesktopCapturerSource’s id. For example “window:1324:0”.

More precisely the format is window:id:other_id where id is HWND on Windows, CGWindowID (uint64_t) on macOS and Window (unsigned long) on Linux. other_id is used to identify web contents (tabs) so within the same top level window.

Returns

string

Inherited from

BrowserWindow.getMediaSourceId


getMinimumSize()

getMinimumSize(): number[]

Defined in: node_modules/electron/electron.d.ts:5142

Contains the window’s minimum width and height.

Returns

number[]

Inherited from

BrowserWindow.getMinimumSize


getNativeWindowHandle()

getNativeWindowHandle(): Buffer

Defined in: node_modules/electron/electron.d.ts:5149

The platform-specific handle of the window.

The native type of the handle is HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux.

Returns

Buffer

Inherited from

BrowserWindow.getNativeWindowHandle


getNormalBounds()

getNormalBounds(): Rectangle

Defined in: node_modules/electron/electron.d.ts:5158

Contains the window bounds of the normal state

Note: whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same Rectangle.

Returns

Rectangle

Inherited from

BrowserWindow.getNormalBounds


getOpacity()

getOpacity(): number

Defined in: node_modules/electron/electron.d.ts:5163

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

Returns

number

Inherited from

BrowserWindow.getOpacity


getParentWindow()

getParentWindow(): null | BrowserWindow

Defined in: node_modules/electron/electron.d.ts:5167

The parent window or null if there is no parent.

Returns

null | BrowserWindow

Inherited from

BrowserWindow.getParentWindow


getPosition()

getPosition(): number[]

Defined in: node_modules/electron/electron.d.ts:5171

Contains the window’s current position.

Returns

number[]

Inherited from

BrowserWindow.getPosition


getRepresentedFilename()

getRepresentedFilename(): string

Defined in: node_modules/electron/electron.d.ts:5177

The pathname of the file the window represents.

Returns

string

Platform

darwin

Inherited from

BrowserWindow.getRepresentedFilename


getSize()

getSize(): number[]

Defined in: node_modules/electron/electron.d.ts:5181

Contains the window’s width and height.

Returns

number[]

Inherited from

BrowserWindow.getSize


getTitle()

getTitle(): string

Defined in: node_modules/electron/electron.d.ts:5188

The title of the native window.

Note: The title of the web page can be different from the title of the native window.

Returns

string

Inherited from

BrowserWindow.getTitle


getWindowButtonPosition()

getWindowButtonPosition(): null | Point

Defined in: node_modules/electron/electron.d.ts:5195

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

Returns

null | Point

Platform

darwin

Inherited from

BrowserWindow.getWindowButtonPosition


hasShadow()

hasShadow(): boolean

Defined in: node_modules/electron/electron.d.ts:5199

Whether the window has a shadow.

Returns

boolean

Inherited from

BrowserWindow.hasShadow


hide()

hide(): void

Defined in: node_modules/electron/electron.d.ts:5203

Hides the window.

Returns

void

Inherited from

BrowserWindow.hide


hookWindowMessage()

hookWindowMessage(message, callback): void

Defined in: node_modules/electron/electron.d.ts:5210

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

Parameters

message

number

callback

(wParam, lParam) => void

Returns

void

Platform

win32

Inherited from

BrowserWindow.hookWindowMessage


invalidateShadow()

invalidateShadow(): void

Defined in: node_modules/electron/electron.d.ts:5221

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

BrowserWindows that are transparent can sometimes leave behind visual artifacts on macOS. This method can be used to clear these artifacts when, for example, performing an animation.

Returns

void

Platform

darwin

Inherited from

BrowserWindow.invalidateShadow


isAlwaysOnTop()

isAlwaysOnTop(): boolean

Defined in: node_modules/electron/electron.d.ts:5225

Whether the window is always on top of other windows.

Returns

boolean

Inherited from

BrowserWindow.isAlwaysOnTop


isClosable()

isClosable(): boolean

Defined in: node_modules/electron/electron.d.ts:5233

Whether the window can be manually closed by user.

On Linux always returns true.

Returns

boolean

Platform

darwin,win32

Inherited from

BrowserWindow.isClosable


isDestroyed()

isDestroyed(): boolean

Defined in: node_modules/electron/electron.d.ts:5237

Whether the window is destroyed.

Returns

boolean

Inherited from

BrowserWindow.isDestroyed


isDocumentEdited()

isDocumentEdited(): boolean

Defined in: node_modules/electron/electron.d.ts:5243

Whether the window’s document has been edited.

Returns

boolean

Platform

darwin

Inherited from

BrowserWindow.isDocumentEdited


isEnabled()

isEnabled(): boolean

Defined in: node_modules/electron/electron.d.ts:5247

whether the window is enabled.

Returns

boolean

Inherited from

BrowserWindow.isEnabled


isFocusable()

isFocusable(): boolean

Defined in: node_modules/electron/electron.d.ts:5253

Whether the window can be focused.

Returns

boolean

Platform

darwin,win32

Inherited from

BrowserWindow.isFocusable


isFocused()

isFocused(): boolean

Defined in: node_modules/electron/electron.d.ts:5257

Whether the window is focused.

Returns

boolean

Inherited from

BrowserWindow.isFocused


isFullScreen()

isFullScreen(): boolean

Defined in: node_modules/electron/electron.d.ts:5265

Whether the window is in fullscreen mode.

Note: On macOS, fullscreen transitions take place asynchronously. When querying for a BrowserWindow’s fullscreen status, you should ensure that either the ‘enter-full-screen’ or ‘leave-full-screen’ events have been emitted.

Returns

boolean

Inherited from

BrowserWindow.isFullScreen


isFullScreenable()

isFullScreenable(): boolean

Defined in: node_modules/electron/electron.d.ts:5270

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

Returns

boolean

Inherited from

BrowserWindow.isFullScreenable


isHiddenInMissionControl()

isHiddenInMissionControl(): boolean

Defined in: node_modules/electron/electron.d.ts:5276

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

Returns

boolean

Platform

darwin

Inherited from

BrowserWindow.isHiddenInMissionControl


isKiosk()

isKiosk(): boolean

Defined in: node_modules/electron/electron.d.ts:5280

Whether the window is in kiosk mode.

Returns

boolean

Inherited from

BrowserWindow.isKiosk


isMaximizable()

isMaximizable(): boolean

Defined in: node_modules/electron/electron.d.ts:5288

Whether the window can be manually maximized by user.

On Linux always returns true.

Returns

boolean

Platform

darwin,win32

Inherited from

BrowserWindow.isMaximizable


isMaximized()

isMaximized(): boolean

Defined in: node_modules/electron/electron.d.ts:5292

Whether the window is maximized.

Returns

boolean

Inherited from

BrowserWindow.isMaximized


isMenuBarAutoHide()

isMenuBarAutoHide(): boolean

Defined in: node_modules/electron/electron.d.ts:5298

Whether menu bar automatically hides itself.

Returns

boolean

Platform

win32,linux

Inherited from

BrowserWindow.isMenuBarAutoHide


isMenuBarVisible()

isMenuBarVisible(): boolean

Defined in: node_modules/electron/electron.d.ts:5304

Whether the menu bar is visible.

Returns

boolean

Platform

win32,linux

Inherited from

BrowserWindow.isMenuBarVisible


isMinimizable()

isMinimizable(): boolean

Defined in: node_modules/electron/electron.d.ts:5312

Whether the window can be manually minimized by the user.

On Linux always returns true.

Returns

boolean

Platform

darwin,win32

Inherited from

BrowserWindow.isMinimizable


isMinimized()

isMinimized(): boolean

Defined in: node_modules/electron/electron.d.ts:5316

Whether the window is minimized.

Returns

boolean

Inherited from

BrowserWindow.isMinimized


isModal()

isModal(): boolean

Defined in: node_modules/electron/electron.d.ts:5320

Whether current window is a modal window.

Returns

boolean

Inherited from

BrowserWindow.isModal


isMovable()

isMovable(): boolean

Defined in: node_modules/electron/electron.d.ts:5328

Whether the window can be moved by user.

On Linux always returns true.

Returns

boolean

Platform

darwin,win32

Inherited from

BrowserWindow.isMovable


isNormal()

isNormal(): boolean

Defined in: node_modules/electron/electron.d.ts:5333

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

Returns

boolean

Inherited from

BrowserWindow.isNormal


isResizable()

isResizable(): boolean

Defined in: node_modules/electron/electron.d.ts:5337

Whether the window can be manually resized by the user.

Returns

boolean

Inherited from

BrowserWindow.isResizable


isSimpleFullScreen()

isSimpleFullScreen(): boolean

Defined in: node_modules/electron/electron.d.ts:5343

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

Returns

boolean

Platform

darwin

Inherited from

BrowserWindow.isSimpleFullScreen


isTabletMode()

isTabletMode(): boolean

Defined in: node_modules/electron/electron.d.ts:5356

Whether the window is in Windows 10 tablet mode.

Since Windows 10 users can use their PC as tablet, under this mode apps can choose to optimize their UI for tablets, such as enlarging the titlebar and hiding titlebar buttons.

This API returns whether the window is in tablet mode, and the resize event can be be used to listen to changes to tablet mode.

Returns

boolean

Platform

win32

Inherited from

BrowserWindow.isTabletMode


isVisible()

isVisible(): boolean

Defined in: node_modules/electron/electron.d.ts:5360

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

Returns

boolean

Inherited from

BrowserWindow.isVisible


isVisibleOnAllWorkspaces()

isVisibleOnAllWorkspaces(): boolean

Defined in: node_modules/electron/electron.d.ts:5368

Whether the window is visible on all workspaces.

Note: This API always returns false on Windows.

Returns

boolean

Platform

darwin,linux

Inherited from

BrowserWindow.isVisibleOnAllWorkspaces


isWindowMessageHooked()

isWindowMessageHooked(message): boolean

Defined in: node_modules/electron/electron.d.ts:5374

true or false depending on whether the message is hooked.

Parameters

message

number

Returns

boolean

Platform

win32

Inherited from

BrowserWindow.isWindowMessageHooked


listenerCount()

listenerCount(eventName): number

Defined in: docs/node_modules/@types/node/events.d.ts:589

Returns the number of listeners listening to the event named eventName.

Parameters

eventName

The name of the event being listened for

string | symbol

Returns

number

Since

v3.2.0

Inherited from

BrowserWindow.listenerCount


listeners()

listeners(eventName): Function[]

Defined in: docs/node_modules/@types/node/events.d.ts:512

Returns a copy of the array of listeners for the event named eventName.

server.on('connection', (stream) => {
console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]

Parameters

eventName

string | symbol

Returns

Function[]

Since

v0.1.26

Inherited from

BrowserWindow.listeners


loadFile()

loadFile(filePath, options?): Promise<void>

Defined in: node_modules/electron/electron.d.ts:5383

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).

Same as webContents.loadFile, filePath should be a path to an HTML file relative to the root of your application. See the webContents docs for more information.

Parameters

filePath

string

options?

LoadFileOptions

Returns

Promise<void>

Inherited from

BrowserWindow.loadFile


loadURL()

loadURL(url, options?): Promise<void>

Defined in: node_modules/electron/electron.d.ts:5399

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).

Same as webContents.loadURL(url[, options]).

The url can be a remote address (e.g. http://) or a path to a local HTML file using the file:// protocol.

To ensure that file URLs are properly formatted, it is recommended to use Node’s url.format method:

You can load a URL using a POST request with URL-encoded data by doing the following:

Parameters

url

string

options?

LoadURLOptions

Returns

Promise<void>

Inherited from

BrowserWindow.loadURL


maximize()

maximize(): void

Defined in: node_modules/electron/electron.d.ts:5404

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

Returns

void

Inherited from

BrowserWindow.maximize


mergeAllWindows()

mergeAllWindows(): void

Defined in: node_modules/electron/electron.d.ts:5411

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

Returns

void

Platform

darwin

Inherited from

BrowserWindow.mergeAllWindows


minimize()

minimize(): void

Defined in: node_modules/electron/electron.d.ts:5416

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

Returns

void

Inherited from

BrowserWindow.minimize


moveAbove()

moveAbove(mediaSourceId): void

Defined in: node_modules/electron/electron.d.ts:5422

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.

Parameters

mediaSourceId

string

Returns

void

Inherited from

BrowserWindow.moveAbove


moveTabToNewWindow()

moveTabToNewWindow(): void

Defined in: node_modules/electron/electron.d.ts:5429

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

Returns

void

Platform

darwin

Inherited from

BrowserWindow.moveTabToNewWindow


moveTop()

moveTop(): void

Defined in: node_modules/electron/electron.d.ts:5433

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

Returns

void

Inherited from

BrowserWindow.moveTop


off()

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3849

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3862

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3891

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3929

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3950

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3958

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3979

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4000

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4009

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4018

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4026

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4034

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4042

Parameters
event

"enter-html-full-screen"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4050

Parameters
event

"focus"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4058

Parameters
event

"focus"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4066

Parameters
event

"hide"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4074

Parameters
event

"hide"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4082

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4090

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4098

Parameters
event

"leave-html-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4106

Parameters
event

"maximize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4114

Parameters
event

"maximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4122

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4130

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4138

Parameters
event

"move"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4146

Parameters
event

"move"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4161

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4185

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4207

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4229

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4250

Parameters
event

"page-title-updated"

listener

(event, title, explicitSet) => void

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4271

Parameters
event

"ready-to-show"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4279

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4287

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4304

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4330

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4347

Parameters
event

"responsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4355

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4363

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4381

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4412

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4439

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4462

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4484

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4506

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4528

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4550

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4567

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4575

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4597

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4632

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4667

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4714

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4747

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4755

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4763

Parameters
event

"unresponsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4784

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4830

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4886

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off

Call Signature

off(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4946

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.off


on()

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3847

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

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3860

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

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3886

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.

Commands are lowercased, underscores are replaced with hyphens, and the APPCOMMAND_ prefix is stripped off. e.g. APPCOMMAND_BROWSER_BACKWARD is emitted as browser-backward.

The following app commands are explicitly supported on Linux:

  • browser-backward
  • browser-forward
Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3924

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.

Commands are lowercased, underscores are replaced with hyphens, and the APPCOMMAND_ prefix is stripped off. e.g. APPCOMMAND_BROWSER_BACKWARD is emitted as browser-backward.

The following app commands are explicitly supported on Linux:

  • browser-backward
  • browser-forward
Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3949

Emitted when the window loses focus.

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3957

Emitted when the window loses focus.

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3978

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.

Usually you would want to use the beforeunload handler to decide whether the window should be closed, which will also be called when the window is reloaded. In Electron, returning any value other than undefined would cancel the close. For example:

Note: There is a subtle difference between the behaviors of window.onbeforeunload = handler and window.addEventListener('beforeunload', handler). It is recommended to always set the event.returnValue explicitly, instead of only returning a value, as the former works more consistently within Electron.

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3999

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.

Usually you would want to use the beforeunload handler to decide whether the window should be closed, which will also be called when the window is reloaded. In Electron, returning any value other than undefined would cancel the close. For example:

Note: There is a subtle difference between the behaviors of window.onbeforeunload = handler and window.addEventListener('beforeunload', handler). It is recommended to always set the event.returnValue explicitly, instead of only returning a value, as the former works more consistently within Electron.

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4008

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.

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4017

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.

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4025

Emitted when the window enters a full-screen state.

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4033

Emitted when the window enters a full-screen state.

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4041

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

Parameters
event

"enter-html-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4049

Emitted when the window gains focus.

Parameters
event

"focus"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4057

Emitted when the window gains focus.

Parameters
event

"focus"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4065

Emitted when the window is hidden.

Parameters
event

"hide"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4073

Emitted when the window is hidden.

Parameters
event

"hide"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4081

Emitted when the window leaves a full-screen state.

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4089

Emitted when the window leaves a full-screen state.

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4097

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

Parameters
event

"leave-html-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4105

Emitted when window is maximized.

Parameters
event

"maximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4113

Emitted when window is maximized.

Parameters
event

"maximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4121

Emitted when the window is minimized.

Parameters
event

"minimize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4129

Emitted when the window is minimized.

Parameters
event

"minimize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4137

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

Parameters
event

"move"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4145

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

Parameters
event

"move"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4157

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

Note: On macOS this event is an alias of move.

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4181

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

Note: On macOS this event is an alias of move.

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4203

Emitted when the native new tab button is clicked.

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4225

Emitted when the native new tab button is clicked.

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4247

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.

Parameters
event

"page-title-updated"

listener

(event, title, explicitSet) => void

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4270

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

Please note that using this event implies that the renderer will be considered “visible” and paint even though show is false. This event will never fire if you use paintWhenInitiallyHidden: false

Parameters
event

"ready-to-show"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4278

Emitted after the window has been resized.

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4286

Emitted after the window has been resized.

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4300

Emitted once when the window has finished being resized.

This is usually emitted when the window has been resized manually. On macOS, resizing the window with setBounds/setSize and setting the animate parameter to true will also emit this event once resizing has finished.

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4326

Emitted once when the window has finished being resized.

This is usually emitted when the window has been resized manually. On macOS, resizing the window with setBounds/setSize and setting the animate parameter to true will also emit this event once resizing has finished.

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4346

Emitted when the unresponsive web page becomes responsive again.

Parameters
event

"responsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4354

Emitted when the window is restored from a minimized state.

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4362

Emitted when the window is restored from a minimized state.

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4376

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.

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4407

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.

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4435

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

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4458

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

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4480

Emitted when the window opens a sheet.

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4502

Emitted when the window opens a sheet.

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4524

Emitted when the window has closed a sheet.

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4546

Emitted when the window has closed a sheet.

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4566

Emitted when the window is shown.

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4574

Emitted when the window is shown.

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4592

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

The method underlying this event is built to handle older macOS-style trackpad swiping, where the content on the screen doesn’t move with the swipe. Most macOS trackpads are not configured to allow this kind of swiping anymore, so in order for it to emit properly the ‘Swipe between pages’ preference in System Preferences > Trackpad > More Gestures must be set to ‘Swipe with two or three fingers’.

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4627

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

The method underlying this event is built to handle older macOS-style trackpad swiping, where the content on the screen doesn’t move with the swipe. Most macOS trackpads are not configured to allow this kind of swiping anymore, so in order for it to emit properly the ‘Swipe between pages’ preference in System Preferences > Trackpad > More Gestures must be set to ‘Swipe with two or three fingers’.

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4659

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.

Calling event.preventDefault() will prevent the menu from being displayed.

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4706

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.

Calling event.preventDefault() will prevent the menu from being displayed.

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4746

Emitted when the window exits from a maximized state.

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4754

Emitted when the window exits from a maximized state.

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4762

Emitted when the web page becomes unresponsive.

Parameters
event

"unresponsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4776

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

Note that this is only emitted when the window is being moved manually. Moving the window with setPosition/setBounds/center will not emit this event.

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4822

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

Note that this is only emitted when the window is being moved manually. Moving the window with setPosition/setBounds/center will not emit this event.

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4877

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

Note that this is only emitted when the window is being resized manually. Resizing the window with setBounds/setSize will not emit this event.

The possible values and behaviors of the edge option are platform dependent. Possible values are:

  • On Windows, possible values are bottom, top, left, right, top-left, top-right, bottom-left, bottom-right.
  • On macOS, possible values are bottom and right.
    • The value bottom is used to denote vertical resizing.
    • The value right is used to denote horizontal resizing.
Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on

Call Signature

on(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4937

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

Note that this is only emitted when the window is being resized manually. Resizing the window with setBounds/setSize will not emit this event.

The possible values and behaviors of the edge option are platform dependent. Possible values are:

  • On Windows, possible values are bottom, top, left, right, top-left, top-right, bottom-left, bottom-right.
  • On macOS, possible values are bottom and right.
    • The value bottom is used to denote vertical resizing.
    • The value right is used to denote horizontal resizing.
Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.on


once()

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3851

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3864

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3896

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3934

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3951

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3959

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3980

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4001

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4010

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4019

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4027

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4035

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4043

Parameters
event

"enter-html-full-screen"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4051

Parameters
event

"focus"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4059

Parameters
event

"focus"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4067

Parameters
event

"hide"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4075

Parameters
event

"hide"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4083

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4091

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4099

Parameters
event

"leave-html-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4107

Parameters
event

"maximize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4115

Parameters
event

"maximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4123

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4131

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4139

Parameters
event

"move"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4147

Parameters
event

"move"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4165

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4189

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4211

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4233

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4253

Parameters
event

"page-title-updated"

listener

(event, title, explicitSet) => void

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4272

Parameters
event

"ready-to-show"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4280

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4288

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4308

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4334

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4348

Parameters
event

"responsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4356

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4364

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4386

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4417

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4443

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4466

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4488

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4510

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4532

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4554

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4568

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4576

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4602

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4637

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4675

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4722

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4748

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4756

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4764

Parameters
event

"unresponsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4792

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4838

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4895

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once

Call Signature

once(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4955

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.once


prependListener()

prependListener(eventName, listener): this

Defined in: docs/node_modules/@types/node/events.d.ts:607

Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

server.prependListener('connection', (stream) => {
console.log('someone connected!');
});

Returns a reference to the EventEmitter, so that calls can be chained.

Parameters

eventName

The name of the event.

string | symbol

listener

(…args) => void

The callback function

Returns

this

Since

v6.0.0

Inherited from

BrowserWindow.prependListener


prependOnceListener()

prependOnceListener(eventName, listener): this

Defined in: docs/node_modules/@types/node/events.d.ts:623

Adds a one-timelistener function for the event named eventName to the_beginning_ of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

server.prependOnceListener('connection', (stream) => {
console.log('Ah, we have our first user!');
});

Returns a reference to the EventEmitter, so that calls can be chained.

Parameters

eventName

The name of the event.

string | symbol

listener

(…args) => void

The callback function

Returns

this

Since

v6.0.0

Inherited from

BrowserWindow.prependOnceListener


previewFile()

previewFile(path, displayName?): void

Defined in: node_modules/electron/electron.d.ts:5439

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

Parameters

path

string

displayName?

string

Returns

void

Platform

darwin

Inherited from

BrowserWindow.previewFile


rawListeners()

rawListeners(eventName): Function[]

Defined in: docs/node_modules/@types/node/events.d.ts:542

Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

const emitter = new EventEmitter();
emitter.once('log', () => console.log('log once'));
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];
// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();
// Logs "log once" to the console and removes the listener
logFnWrapper();
emitter.on('log', () => console.log('log persistently'));
// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');
// Logs "log persistently" twice
newListeners[0]();
emitter.emit('log');

Parameters

eventName

string | symbol

Returns

Function[]

Since

v9.4.0

Inherited from

BrowserWindow.rawListeners


reload()

reload(): void

Defined in: node_modules/electron/electron.d.ts:5443

Same as webContents.reload.

Returns

void

Inherited from

BrowserWindow.reload


removeAllListeners()

removeAllListeners(event?): this

Defined in: docs/node_modules/@types/node/events.d.ts:483

Removes all listeners, or those of the specified eventName.

It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

Returns a reference to the EventEmitter, so that calls can be chained.

Parameters

event?

string | symbol

Returns

this

Since

v0.1.26

Inherited from

BrowserWindow.removeAllListeners


removeBrowserView()

removeBrowserView(browserView): void

Defined in: node_modules/electron/electron.d.ts:5451

Note The BrowserView class is deprecated, and replaced by the new WebContentsView class.

Parameters

browserView

BrowserView

Returns

void

Inherited from

BrowserWindow.removeBrowserView


removeListener()

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3855

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3868

Parameters
event

"always-on-top-changed"

listener

(event, isAlwaysOnTop) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3906

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3944

Parameters
event

"app-command"

listener

(event, command) => void

Returns

this

Platform

win32,linux

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3953

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3961

Parameters
event

"blur"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:3982

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4003

Parameters
event

"close"

listener

(event) => void

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4012

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4021

Parameters
event

"closed"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4029

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4037

Parameters
event

"enter-full-screen"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4045

Parameters
event

"enter-html-full-screen"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4053

Parameters
event

"focus"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4061

Parameters
event

"focus"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4069

Parameters
event

"hide"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4077

Parameters
event

"hide"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4085

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4093

Parameters
event

"leave-full-screen"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4101

Parameters
event

"leave-html-full-screen"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4109

Parameters
event

"maximize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4117

Parameters
event

"maximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4125

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4133

Parameters
event

"minimize"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4141

Parameters
event

"move"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4149

Parameters
event

"move"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4173

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4197

Parameters
event

"moved"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4219

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4241

Parameters
event

"new-window-for-tab"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4259

Parameters
event

"page-title-updated"

listener

(event, title, explicitSet) => void

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4274

Parameters
event

"ready-to-show"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4282

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4290

Parameters
event

"resize"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4316

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4342

Parameters
event

"resized"

listener

Function

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4350

Parameters
event

"responsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4358

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4366

Parameters
event

"restore"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4396

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4427

Parameters
event

"rotate-gesture"

listener

(event, rotation) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4451

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4474

Parameters
event

"session-end"

listener

Function

Returns

this

Platform

win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4496

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4518

Parameters
event

"sheet-begin"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4540

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4562

Parameters
event

"sheet-end"

listener

Function

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4570

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4578

Parameters
event

"show"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4612

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4647

Parameters
event

"swipe"

listener

(event, direction) => void

Returns

this

Platform

darwin

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4691

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4738

Parameters
event

"system-context-menu"

listener

(event, point) => void

Returns

this

Platform

win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4750

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4758

Parameters
event

"unmaximize"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4766

Parameters
event

"unresponsive"

listener

Function

Returns

this

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4808

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4854

Parameters
event

"will-move"

listener

(event, newBounds) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4913

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener

Call Signature

removeListener(event, listener): this

Defined in: node_modules/electron/electron.d.ts:4973

Parameters
event

"will-resize"

listener

(event, newBounds, details) => void

Returns

this

Platform

darwin,win32

Inherited from

BrowserWindow.removeListener


removeMenu()

removeMenu(): void

Defined in: node_modules/electron/electron.d.ts:5457

Remove the window’s menu bar.

Returns

void

Platform

linux,win32

Inherited from

BrowserWindow.removeMenu


restore()

restore(): void

Defined in: node_modules/electron/electron.d.ts:5461

Restores the window from minimized state to its previous state.

Returns

void

Inherited from

BrowserWindow.restore


selectNextTab()

selectNextTab(): void

Defined in: node_modules/electron/electron.d.ts:5468

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

Returns

void

Platform

darwin

Inherited from

BrowserWindow.selectNextTab


selectPreviousTab()

selectPreviousTab(): void

Defined in: node_modules/electron/electron.d.ts:5475

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

Returns

void

Platform

darwin

Inherited from

BrowserWindow.selectPreviousTab


setAlwaysOnTop()

setAlwaysOnTop(flag, level?, relativeLevel?): void

Defined in: node_modules/electron/electron.d.ts:5481

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.

Parameters

flag

boolean

level?

"normal" | "floating" | "torn-off-menu" | "modal-panel" | "main-menu" | "status" | "pop-up-menu" | "screen-saver"

relativeLevel?

number

Returns

void

Inherited from

BrowserWindow.setAlwaysOnTop


setAppDetails()

setAppDetails(options): void

Defined in: node_modules/electron/electron.d.ts:5490

Sets the properties for the window’s taskbar button.

Note: relaunchCommand and relaunchDisplayName must always be set together. If one of those properties is not set, then neither will be used.

Parameters

options

AppDetailsOptions

Returns

void

Platform

win32

Inherited from

BrowserWindow.setAppDetails


setAspectRatio()

setAspectRatio(aspectRatio, extraSize?): void

Defined in: node_modules/electron/electron.d.ts:5512

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.

Consider a normal window with an HD video player and associated controls. Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and { width: 40, height: 50 }. The second argument doesn’t care where the extra width and height are within the content view—only that they exist. Sum any extra width and height areas you have within the overall content view.

The aspect ratio is not respected when window is resized programmatically with APIs like win.setSize.

To reset an aspect ratio, pass 0 as the aspectRatio value: win.setAspectRatio(0).

Parameters

aspectRatio

number

extraSize?

Size

Returns

void

Inherited from

BrowserWindow.setAspectRatio


setAutoHideCursor()

setAutoHideCursor(autoHide): void

Defined in: node_modules/electron/electron.d.ts:5518

Controls whether to hide cursor when typing.

Parameters

autoHide

boolean

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setAutoHideCursor


setAutoHideMenuBar()

setAutoHideMenuBar(hide): void

Defined in: node_modules/electron/electron.d.ts:5528

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.

If the menu bar is already visible, calling setAutoHideMenuBar(true) won’t hide it immediately.

Parameters

hide

boolean

Returns

void

Platform

win32,linux

Inherited from

BrowserWindow.setAutoHideMenuBar


setBackgroundColor()

setBackgroundColor(backgroundColor): void

Defined in: node_modules/electron/electron.d.ts:5556

Examples of valid backgroundColor values:

  • Hex
    • #fff (shorthand RGB)
    • #ffff (shorthand ARGB)
    • #ffffff (RGB)
    • #ffffffff (ARGB)
  • RGB
    • rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)
      • e.g. rgb(255, 255, 255)
  • RGBA
    • rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)
      • e.g. rgba(255, 255, 255, 1.0)
  • HSL
    • hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)
      • e.g. hsl(200, 20%, 50%)
  • HSLA
    • hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)
      • e.g. hsla(200, 20%, 50%, 0.5)
  • Color name
    • Options are listed in SkParseColor.cpp
    • Similar to CSS Color Module Level 3 keywords, but case-sensitive.
      • e.g. blueviolet or red

Sets the background color of the window. See Setting backgroundColor.

Parameters

backgroundColor

string

Returns

void

Inherited from

BrowserWindow.setBackgroundColor


setBackgroundMaterial()

setBackgroundMaterial(material): void

Defined in: node_modules/electron/electron.d.ts:5567

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

See the Windows documentation for more details.

Note: This method is only supported on Windows 11 22H2 and up.

Parameters

material

"none" | "auto" | "mica" | "acrylic" | "tabbed"

Returns

void

Platform

win32

Inherited from

BrowserWindow.setBackgroundMaterial


setBounds()

setBounds(bounds, animate?): void

Defined in: node_modules/electron/electron.d.ts:5577

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

Note: On macOS, the y-coordinate value cannot be smaller than the Tray height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.

Parameters

bounds

Partial<Rectangle>

animate?

boolean

Returns

void

Inherited from

BrowserWindow.setBounds


setBrowserView()

setBrowserView(browserView): void

Defined in: node_modules/electron/electron.d.ts:5585

Note The BrowserView class is deprecated, and replaced by the new WebContentsView class.

Parameters

browserView

null | BrowserView

Returns

void

Inherited from

BrowserWindow.setBrowserView


setClosable()

setClosable(closable): void

Defined in: node_modules/electron/electron.d.ts:5591

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

Parameters

closable

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setClosable


setContentBounds()

setContentBounds(bounds, animate?): void

Defined in: node_modules/electron/electron.d.ts:5596

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

Parameters

bounds

Rectangle

animate?

boolean

Returns

void

Inherited from

BrowserWindow.setContentBounds


setContentProtection()

setContentProtection(enable): void

Defined in: node_modules/electron/electron.d.ts:5607

Prevents the window contents from being captured by other apps.

On macOS it sets the NSWindow’s sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with WDA_EXCLUDEFROMCAPTURE. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if WDA_MONITOR is applied capturing a black window.

Parameters

enable

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setContentProtection


setContentSize()

setContentSize(width, height, animate?): void

Defined in: node_modules/electron/electron.d.ts:5611

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

Parameters

width

number

height

number

animate?

boolean

Returns

void

Inherited from

BrowserWindow.setContentSize


setContentView()

setContentView(view): void

Defined in: node_modules/electron/electron.d.ts:3007

Sets the content view of the window.

Parameters

view

View

Returns

void

Inherited from

BrowserWindow.setContentView


setDocumentEdited()

setDocumentEdited(edited): void

Defined in: node_modules/electron/electron.d.ts:5618

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

Parameters

edited

boolean

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setDocumentEdited


setEnabled()

setEnabled(enable): void

Defined in: node_modules/electron/electron.d.ts:5622

Disable or enable the window.

Parameters

enable

boolean

Returns

void

Inherited from

BrowserWindow.setEnabled


setFocusable()

setFocusable(focusable): void

Defined in: node_modules/electron/electron.d.ts:5630

Changes whether the window can be focused.

On macOS it does not remove the focus from the window.

Parameters

focusable

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setFocusable


setFullScreen()

setFullScreen(flag): void

Defined in: node_modules/electron/electron.d.ts:5638

Sets whether the window should be in fullscreen mode.

Note: On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ‘enter-full-screen’ or ‘leave-full-screen’ events.

Parameters

flag

boolean

Returns

void

Inherited from

BrowserWindow.setFullScreen


setFullScreenable()

setFullScreenable(fullscreenable): void

Defined in: node_modules/electron/electron.d.ts:5643

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

Parameters

fullscreenable

boolean

Returns

void

Inherited from

BrowserWindow.setFullScreenable


setHasShadow()

setHasShadow(hasShadow): void

Defined in: node_modules/electron/electron.d.ts:5647

Sets whether the window should have a shadow.

Parameters

hasShadow

boolean

Returns

void

Inherited from

BrowserWindow.setHasShadow


setHiddenInMissionControl()

setHiddenInMissionControl(hidden): void

Defined in: node_modules/electron/electron.d.ts:5654

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

Parameters

hidden

boolean

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setHiddenInMissionControl


setIcon()

setIcon(icon): void

Defined in: node_modules/electron/electron.d.ts:5660

Changes window icon.

Parameters

icon

string | NativeImage

Returns

void

Platform

win32,linux

Inherited from

BrowserWindow.setIcon


setIgnoreMouseEvents()

setIgnoreMouseEvents(ignore, options?): void

Defined in: node_modules/electron/electron.d.ts:5667

Makes the window ignore all mouse events.

All mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events.

Parameters

ignore

boolean

options?

IgnoreMouseEventsOptions

Returns

void

Inherited from

BrowserWindow.setIgnoreMouseEvents


setKiosk()

setKiosk(flag): void

Defined in: node_modules/electron/electron.d.ts:5671

Enters or leaves kiosk mode.

Parameters

flag

boolean

Returns

void

Inherited from

BrowserWindow.setKiosk


setMaximizable()

setMaximizable(maximizable): void

Defined in: node_modules/electron/electron.d.ts:5678

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

Parameters

maximizable

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setMaximizable


setMaximumSize()

setMaximumSize(width, height): void

Defined in: node_modules/electron/electron.d.ts:5682

Sets the maximum size of window to width and height.

Parameters

width

number

height

number

Returns

void

Inherited from

BrowserWindow.setMaximumSize


setMaxListeners()

setMaxListeners(n): this

Defined in: docs/node_modules/@types/node/events.d.ts:493

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set toInfinity (or 0) to indicate an unlimited number of listeners.

Returns a reference to the EventEmitter, so that calls can be chained.

Parameters

n

number

Returns

this

Since

v0.3.5

Inherited from

BrowserWindow.setMaxListeners


setMenu()

setMenu(menu): void

Defined in: node_modules/electron/electron.d.ts:5688

Sets the menu as the window’s menu bar.

Parameters

null | Menu

Returns

void

Platform

linux,win32

Inherited from

BrowserWindow.setMenu


setMenuBarVisibility()

setMenuBarVisibility(visible): void

Defined in: node_modules/electron/electron.d.ts:5695

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.

Parameters

visible

boolean

Returns

void

Platform

win32,linux

Inherited from

BrowserWindow.setMenuBarVisibility


setMinimizable()

setMinimizable(minimizable): void

Defined in: node_modules/electron/electron.d.ts:5702

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

Parameters

minimizable

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setMinimizable


setMinimumSize()

setMinimumSize(width, height): void

Defined in: node_modules/electron/electron.d.ts:5706

Sets the minimum size of window to width and height.

Parameters

width

number

height

number

Returns

void

Inherited from

BrowserWindow.setMinimumSize


setMovable()

setMovable(movable): void

Defined in: node_modules/electron/electron.d.ts:5712

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

Parameters

movable

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setMovable


setOpacity()

setOpacity(opacity): void

Defined in: node_modules/electron/electron.d.ts:5719

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

Parameters

opacity

number

Returns

void

Platform

win32,darwin

Inherited from

BrowserWindow.setOpacity


setOverlayIcon()

setOverlayIcon(overlay, description): void

Defined in: node_modules/electron/electron.d.ts:5726

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.

Parameters

overlay

null | NativeImage

description

string

Returns

void

Platform

win32

Inherited from

BrowserWindow.setOverlayIcon


setParentWindow()

setParentWindow(parent): void

Defined in: node_modules/electron/electron.d.ts:5731

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

Parameters

parent

null | BrowserWindow

Returns

void

Inherited from

BrowserWindow.setParentWindow


setPosition()

setPosition(x, y, animate?): void

Defined in: node_modules/electron/electron.d.ts:5735

Moves window to x and y.

Parameters

x

number

y

number

animate?

boolean

Returns

void

Inherited from

BrowserWindow.setPosition


setProgressBar()

setProgressBar(progress, options?): void

Defined in: node_modules/electron/electron.d.ts:5750

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

Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1.

On Linux platform, only supports Unity desktop environment, you need to specify the *.desktop file name to desktopName field in package.json. By default, it will assume {app.name}.desktop.

On Windows, a mode can be passed. Accepted values are none, normal, indeterminate, error, and paused. If you call setProgressBar without a mode set (but with a value within the valid range), normal will be assumed.

Parameters

progress

number

options?

ProgressBarOptions

Returns

void

Inherited from

BrowserWindow.setProgressBar


setRepresentedFilename()

setRepresentedFilename(filename): void

Defined in: node_modules/electron/electron.d.ts:5757

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

Parameters

filename

string

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setRepresentedFilename


setResizable()

setResizable(resizable): void

Defined in: node_modules/electron/electron.d.ts:5761

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

Parameters

resizable

boolean

Returns

void

Inherited from

BrowserWindow.setResizable


setShape()

setShape(rects): void

Defined in: node_modules/electron/electron.d.ts:5772

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.

Parameters

rects

Rectangle[]

Returns

void

Platform

win32,linux

Inherited from

BrowserWindow.setShape


setSheetOffset()

setSheetOffset(offsetY, offsetX?): void

Defined in: node_modules/electron/electron.d.ts:5780

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:

Parameters

offsetY

number

offsetX?

number

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setSheetOffset


setSimpleFullScreen()

setSimpleFullScreen(flag): void

Defined in: node_modules/electron/electron.d.ts:5789

Enters or leaves simple fullscreen mode.

Simple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).

Parameters

flag

boolean

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setSimpleFullScreen


setSize()

setSize(width, height, animate?): void

Defined in: node_modules/electron/electron.d.ts:5794

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.

Parameters

width

number

height

number

animate?

boolean

Returns

void

Inherited from

BrowserWindow.setSize


setSkipTaskbar()

setSkipTaskbar(skip): void

Defined in: node_modules/electron/electron.d.ts:5800

Makes the window not show in the taskbar.

Parameters

skip

boolean

Returns

void

Platform

darwin,win32

Inherited from

BrowserWindow.setSkipTaskbar


setThumbarButtons()

setThumbarButtons(buttons): boolean

Defined in: node_modules/electron/electron.d.ts:5837

Whether the buttons were added successfully

Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a boolean object indicates whether the thumbnail has been added successfully.

The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform’s limitation. But you can call the API with an empty array to clean the buttons.

The buttons is an array of Button objects:

  • Button Object
    • icon NativeImage - The icon showing in thumbnail toolbar.
    • click Function
    • tooltip string (optional) - The text of the button’s tooltip.
    • flags string[] (optional) - Control specific states and behaviors of the button. By default, it is ['enabled'].

The flags is an array that can include following strings:

  • enabled - The button is active and available to the user.
  • disabled - The button is disabled. It is present, but has a visual state indicating it will not respond to user action.
  • dismissonclick - When the button is clicked, the thumbnail window closes immediately.
  • nobackground - Do not draw a button border, use only the image.
  • hidden - The button is not shown to the user.
  • noninteractive - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification.

Parameters

buttons

ThumbarButton[]

Returns

boolean

Platform

win32

Inherited from

BrowserWindow.setThumbarButtons


setThumbnailClip()

setThumbnailClip(region): void

Defined in: node_modules/electron/electron.d.ts:5846

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 }.

Parameters

region

Rectangle

Returns

void

Platform

win32

Inherited from

BrowserWindow.setThumbnailClip


setThumbnailToolTip()

setThumbnailToolTip(toolTip): void

Defined in: node_modules/electron/electron.d.ts:5853

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

Parameters

toolTip

string

Returns

void

Platform

win32

Inherited from

BrowserWindow.setThumbnailToolTip


setTitle()

setTitle(title): void

Defined in: node_modules/electron/electron.d.ts:5857

Changes the title of native window to title.

Parameters

title

string

Returns

void

Inherited from

BrowserWindow.setTitle


setTitleBarOverlay()

setTitleBarOverlay(options): void

Defined in: node_modules/electron/electron.d.ts:5867

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

On Linux, the symbolColor is automatically calculated to have minimum accessible contrast to the color if not explicitly set.

Parameters

options

TitleBarOverlayOptions

Returns

void

Platform

win32,linux

Inherited from

BrowserWindow.setTitleBarOverlay


setTopBrowserView()

setTopBrowserView(browserView): void

Defined in: node_modules/electron/electron.d.ts:5878

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

Note The BrowserView class is deprecated, and replaced by the new WebContentsView class.

Parameters

browserView

BrowserView

Returns

void

Inherited from

BrowserWindow.setTopBrowserView


setTouchBar()

setTouchBar(touchBar): void

Defined in: node_modules/electron/electron.d.ts:5889

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.

Note: The TouchBar API is currently experimental and may change or be removed in future Electron releases.

Parameters

touchBar

null | TouchBar

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setTouchBar


setVibrancy()

setVibrancy(type): void

Defined in: node_modules/electron/electron.d.ts:5896

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

Parameters

type

null | "window" | "titlebar" | "selection" | "menu" | "popover" | "sidebar" | "header" | "sheet" | "hud" | "fullscreen-ui" | "tooltip" | "content" | "under-window" | "under-page"

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setVibrancy


setVisibleOnAllWorkspaces()

setVisibleOnAllWorkspaces(visible, options?): void

Defined in: node_modules/electron/electron.d.ts:5904

Sets whether the window should be visible on all workspaces.

Note: This API does nothing on Windows.

Parameters

visible

boolean

options?

VisibleOnAllWorkspacesOptions

Returns

void

Platform

darwin,linux

Inherited from

BrowserWindow.setVisibleOnAllWorkspaces


setWindowButtonPosition()

setWindowButtonPosition(position): void

Defined in: node_modules/electron/electron.d.ts:5911

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

Parameters

position

null | Point

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setWindowButtonPosition


setWindowButtonVisibility()

setWindowButtonVisibility(visible): void

Defined in: node_modules/electron/electron.d.ts:5917

Sets whether the window traffic light buttons should be visible.

Parameters

visible

boolean

Returns

void

Platform

darwin

Inherited from

BrowserWindow.setWindowButtonVisibility


show()

show(): void

Defined in: node_modules/electron/electron.d.ts:5921

Shows and gives focus to the window.

Returns

void

Inherited from

BrowserWindow.show


showAllTabs()

showAllTabs(): void

Defined in: node_modules/electron/electron.d.ts:5927

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

Returns

void

Platform

darwin

Inherited from

BrowserWindow.showAllTabs


showDefinitionForSelection()

showDefinitionForSelection(): void

Defined in: node_modules/electron/electron.d.ts:5933

Same as webContents.showDefinitionForSelection().

Returns

void

Platform

darwin

Inherited from

BrowserWindow.showDefinitionForSelection


showInactive()

showInactive(): void

Defined in: node_modules/electron/electron.d.ts:5937

Shows the window but doesn’t focus on it.

Returns

void

Inherited from

BrowserWindow.showInactive


toggleTabBar()

toggleTabBar(): void

Defined in: node_modules/electron/electron.d.ts:5944

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

Returns

void

Platform

darwin

Inherited from

BrowserWindow.toggleTabBar


unhookAllWindowMessages()

unhookAllWindowMessages(): void

Defined in: node_modules/electron/electron.d.ts:5950

Unhooks all of the window messages.

Returns

void

Platform

win32

Inherited from

BrowserWindow.unhookAllWindowMessages


unhookWindowMessage()

unhookWindowMessage(message): void

Defined in: node_modules/electron/electron.d.ts:5956

Unhook the window message.

Parameters

message

number

Returns

void

Platform

win32

Inherited from

BrowserWindow.unhookWindowMessage


unmaximize()

unmaximize(): void

Defined in: node_modules/electron/electron.d.ts:5960

Unmaximizes the window.

Returns

void

Inherited from

BrowserWindow.unmaximize