Dock
Allows controlling application icon in the Dock on macOS.
import { dock } from '@mobrowser/api';
Example
import { dock } from '@mobrowser/api';
dock.setBadgeText('3')
console.log(dock.isVisible)
Properties
isVisible
readonly isVisible: boolean;
Whether the application icon is visible in the Dock.
Methods
show()
show(): void;
Shows the application icon in the Dock.
hide()
hide(): void;
Hides the application icon in the Dock.
setBadgeText()
setBadgeText(text: string): void;
Sets the badge text of the application icon in the Dock.
If you don’t see the badge text after calling this method, then go to System Preferences > Notifications and make sure your app is enabled for notifications and the “Badge application icon” option is enabled.
| Parameter | Type | Description |
|---|---|---|
text | string | The badge text to display. Use an empty string to clear the badge. |
getBadgeText()
getBadgeText(): string;
Gets the badge text of the application icon in the Dock.