In the latest version of the Battery Status API draft (http://www.w3.org/TR/battery-status/), a BatteryManager object is obtained by calling navigator.getBattery() , which return a promise resolving into the object. This version of the draft is the one currently implemented in Chrome >= 38, and this PR adds should make the battery example compatible with these changes (while retaining backward compatibility with the old navigator.battery).
In the latest version of the Battery Status API draft (http://www.w3.org/TR/battery-status/), a BatteryManager object is obtained by calling
navigator.getBattery()
, which return a promise resolving into the object. This version of the draft is the one currently implemented in Chrome >= 38, and this PR adds should make the battery example compatible with these changes (while retaining backward compatibility with the oldnavigator.battery
).