Process:
This class is not exported from the 'electron'
module. It is only available as a return value of other methods in the Electron API.
The following example shows how to bounce your icon on the dock.
dock.bounce([type])
macOS
- string (optional) - Can be
critical
orinformational
. The default isinformational
Returns Integer
- an ID representing the request.
When critical
is passed, the dock icon will bounce until either the
application becomes active or the request is canceled.
Note: This method can only be used while the app is not focused; when the app is focused it will return -1.
dock.cancelBounce(id)
macOS
id
Integer
Cancel the bounce of id
.
dock.downloadFinished(filePath)
macOS
filePath
string
Bounces the Downloads stack if the filePath is inside the Downloads folder.
dock.setBadge(text)
macOS
- string
Sets the string to be displayed in the dock’s badging area.
dock.getBadge()
macOS
dock.hide()
macOS
Hides the dock icon.
dock.show()
macOS
Returns Promise<void>
- Resolves when the dock icon is shown.
dock.isVisible()
macOS
Returns boolean
- Whether the dock icon is visible.
dock.setMenu(menu)
macOS
menu
Sets the application’s [dock menu][dock-menu].
dock.getMenu()
macOS
dock.setIcon(image)
macOS
Sets the image
associated with this dock icon.