You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
powerMonitor triggers events when the computer goes on AC or on battery. But there's no way to know on app startup whether the system is already on battery or AC. An event isn't triggered until the state change happens.
I learned from this comment that Electron inherits powerMonitor from Chromium. Well, Chromium's PowerMonitor class has a IsOnBatteryPower method.
Proposed Solution
Add an isOnBatteryPower method to the powerMonitor module.
Alternatives Considered
Alternatively, Electron could fire the on-ac or on-battery event on app startup. In fact, perhaps this should also be the case. (I verified it does not currently do this)
Additional Information
n/a
The text was updated successfully, but these errors were encountered:
Preflight Checklist
Problem Description
powerMonitor triggers events when the computer goes on AC or on battery. But there's no way to know on app startup whether the system is already on battery or AC. An event isn't triggered until the state change happens.
I learned from this comment that Electron inherits powerMonitor from Chromium. Well, Chromium's
PowerMonitor
class has a IsOnBatteryPower method.Proposed Solution
Add an
isOnBatteryPower
method to the powerMonitor module.Alternatives Considered
Alternatively, Electron could fire the
on-ac
oron-battery
event on app startup. In fact, perhaps this should also be the case. (I verified it does not currently do this)Additional Information
n/a
The text was updated successfully, but these errors were encountered: