Porcentaje de batería JS

navigator.getBattery()
  .then(function(battery) {
    console.log(battery.level);
});
Muddy Macaw