IOverwolfCRNApi
Electron APIs / crn / IOverwolfCRNApi
Interface for interacting with the Overwolf Content Recommendation Notification (CRN) system.
Provides methods to query notification state, control visibility, and respond to notification events.
Extends EventEmitter, so once, off and removeListener are also available.
Extends
EventEmitter
Methods
allowNotifications()
allowNotifications(enable: boolean): Promise<void>;
Enable or disable notifications.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable | boolean | true to enable notifications, false to disable. |
Returns
Promise<void>
A promise that resolves once the setting has been applied.
closeNotificationWindow()
closeNotificationWindow(): void;
Closes the notification.
Returns
void
getNotificationStatus()
getNotificationStatus(): Promise<boolean>;
Returns Notification settings status.
true if notifications are allowed, false if not.
Returns
Promise<boolean>
isNotificationVisible()
isNotificationVisible(): Promise<boolean>;
Returns Notification visible status.
true if the notification is currently visible, false if not.
Returns
Promise<boolean>
on("before-notification")
on(eventName: "before-notification", listener: (event: ICRNEvent, args?: undefined) => void): this;
Fires before a notification is shown. Typically used to abort a notification (e.g., inappropriate timing).
Parameters
| Parameter | Type | Description |
|---|---|---|
eventName | "before-notification" | 'before-notification' |
listener | (event: ICRNEvent, args?: undefined) => void | Called synchronously before the notification is shown. Call event.abort() inside the listener to prevent the notification from showing. The second args parameter is always undefined; it is kept only so existing two-parameter listeners still compile. |
Returns
this
on("notification-action")
on(eventName: "notification-action", listener: (action: CRNActionType) => void): this;
Fires when a notification action is triggered.
Parameters
| Parameter | Type | Description |
|---|---|---|
eventName | "notification-action" | 'notification-action' |
listener | (action: CRNActionType) => void | Receives the CRNActionType describing what happened to the notification. |
Returns
this