Used navigator.getBattery() instead navigator.battery in EnergyManager
Made it work navigator.getBattery (for Chrome and Opera) AND the deprecated navigator.battery (for Firefox)