Skip to content

ElectronSystemPreferences.once method

ElectronSystemPreferences › once

Unofficial

Registers a one-time listener for the accent-color-changed event. The listener is removed after it is invoked once.

Signature:

once(event: "accent-color-changed", listener: (event: ElectronEvent, newColor: string) => void): this

Parameters:

ParameterTypeDescription
event"accent-color-changed"The event name.
listener(event: ElectronEvent, newColor: string) => voidThe event handler.

Returns: thisThis ElectronSystemPreferences instance.


Unofficial

Registers a one-time listener for the color-changed event. The listener is removed after it is invoked once.

Signature:

once(event: "color-changed", listener: (event: ElectronEvent) => void): this

Parameters:

ParameterTypeDescription
event"color-changed"The event name.
listener(event: ElectronEvent) => voidThe event handler.

Returns: thisThis ElectronSystemPreferences instance.


Unofficial

Registers a one-time listener for the high-contrast-color-scheme-changed event. The listener is removed after it is invoked once.

Signature:

once(event: "high-contrast-color-scheme-changed", listener: (event: ElectronEvent, highContrastColorScheme: boolean) => void): this

Parameters:

ParameterTypeDescription
event"high-contrast-color-scheme-changed"The event name.
listener(event: ElectronEvent, highContrastColorScheme: boolean) => voidThe event handler.

Returns: thisThis ElectronSystemPreferences instance.


Unofficial

Registers a one-time listener for the inverted-color-scheme-changed event. The listener is removed after it is invoked once.

Signature:

once(event: "inverted-color-scheme-changed", listener: (event: ElectronEvent, invertedColorScheme: boolean) => void): this

Parameters:

ParameterTypeDescription
event"inverted-color-scheme-changed"The event name.
listener(event: ElectronEvent, invertedColorScheme: boolean) => voidThe event handler.

Returns: thisThis ElectronSystemPreferences instance.