electron#powerSaveBlocker JavaScript Examples
The following examples show how to use
electron#powerSaveBlocker.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnergyManager.js From ntfstool with MIT License | 6 votes |
stopPowerSaveBlocker () {
if (typeof psbId === 'undefined' || !powerSaveBlocker.isStarted(psbId)) {
return
}
powerSaveBlocker.stop(psbId)
console.log('stopPowerSaveBlocker===>', psbId)
psbId = undefined
}
Example #2
Source File: EnergyManager.js From ntfstool with MIT License | 5 votes |
startPowerSaveBlocker () {
if (psbId && powerSaveBlocker.isStarted(psbId)) {
return
}
psbId = powerSaveBlocker.start('prevent-app-suspension')
console.log('startPowerSaveBlocker===>', psbId)
}