Header menu logo fable-electron-docs-api

powerSaveBlocker Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ✔

Block the system from entering low-power (sleep) mode.Process: MainFor example:

Static members

Static member Description

powerSaveBlocker.isStarted id

Full Usage: powerSaveBlocker.isStarted id

Parameters:
    id : int

Returns: bool
Modifiers: inline

Whether the corresponding powerSaveBlocker has started.

id : int
Returns: bool

powerSaveBlocker.start type

Full Usage: powerSaveBlocker.start type

Parameters:
Returns: int
Modifiers: inline

The blocker ID that is assigned to this power blocker.Starts preventing the system from entering lower-power mode. Returns an integer identifying the power save blocker.> [!NOTE] prevent-display-sleep has higher precedence over prevent-app-suspension. Only the highest precedence type takes effect. In other words, prevent-display-sleep always takes precedence over prevent-app-suspension.For example, an API calling A requests for prevent-app-suspension, and another calling B requests for prevent-display-sleep. prevent-display-sleep will be used until B stops its request. After that, prevent-app-suspension is used.

type : Type
Returns: int

powerSaveBlocker.stop id

Full Usage: powerSaveBlocker.stop id

Parameters:
    id : int

Returns: bool
Modifiers: inline

Stops the specified power save blocker.Whether the specified powerSaveBlocker has been stopped.

id : int
Returns: bool

Type something to start searching.