API Reference¶
Work in Progress
For now most of the APIs listed below are linked to the Electron documentation pages respectfully.
Please be aware that they work similarly, but probably not exactly the same.
app¶
Events¶
Methods¶
quit()
exit([exitCode])
isReady()
whenReady()
getPath(name)
(supported names:home
,appData
,temp
,desktop
,documents
,downloads
,music
,pictures
,videos
,home
,userData
)setPath(name, path)
getVersion()
getName()
setName(name)
BrowserWindow¶
new BrowserWindow(options)
¶
Supported options
fields:
width
,height
x
,y
center
minWidth
,minHeight
,maxWidth
,maxHeight
resizable
,minimizable
,maximizable
,closable
icon
(path string only)frame
title
show
vibrancy
menu
titleBarStyle
(supported values:default
,hidden
,hiddenInset
)
Instance Events¶
Instance Methods¶
destroy()
close()
minimize()
isDestroyed()
show()
setSize(width, height[, animate])
getSize()
setMinimumSize(width, height)
setMaximumSize(width, height)
setMenu(menu)
setIcon(icon)
setPosition(x, y[, animate])
getPosition()
setTitle(title)
getTitle()
loadFile(filePath)
(not supporting theoptions
parameter)loadURL(url)
(not supporting theoptions
parameter)
Instance Properties¶
webView
(alias:webContents
)id
Static Methods¶
getAllWindows()
getFocusedWindow()
fromWebView(webView)
(alias:fromWebContents(webContents)
)fromId(id)
WebView
(alias: WebContents)¶
Instance Methods¶
isDestroyed()
loadFile(filePath)
(not supporting theoptions
parameter)loadURL(url)
(not supporting theoptions
parameter)reload()
send(channel[, arg1][, arg2][, ...])
Instance Properties¶
webViews
(alias: webContents
)¶
Methods¶
getAllWebViews()
(alias:getAllWebContents()
)getFocusedWebView()
(alias:getFocusedWebContents()
)fromId(id)
messageUI
(alias: ipcRenderer
)¶
Methods¶
messageNode
(alias: ipcMain
)¶
Methods¶
dialog
¶
Methods¶
showErrorBox(title, content)
showOpenDialog(browserWindow, options, callback)
showSaveDialog(browserWindow, options, callback)
shell
¶
Methods¶
shell.openExternal(url)
(not supportingoptions
andcallback
)
systemPreferences
¶
Methods¶
isDarkMode()
(available on macOS and Windows)
Events¶
dark-mode-toggled
(available on macOS and Windows): will be emitted when the user turns on or turns off the system‘s dark mode.