1 year ago

#353233

test-img

Olga

Is there a way to detect there is no battery on the device in js?

I have a minix ks controller which is working from plug and doesn't have a battery. However I'm getting battery data from JS navigator object:

enter image description here

This is what I'm getting from getBattery method:

enter image description here

But I need to detect there is no battery in the device to not show battery indicator on the screen. Is there any way in JS to detect there is no battery at all?

javascript

battery

minix

0 Answers

Your Answer

Accepted video resources