留出时间,直到电池耗尽
// Get the battery API
navigator.getBattery().then(function(battery) {
console.log( "Battery will drain in ", battery.dischargingTime, " seconds" );
});
// Get the battery API
navigator.getBattery().then(function(battery) {
console.log( "Battery will drain in ", battery.dischargingTime, " seconds" );
});