summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/battery-level.js
blob: 07f95756815e8e9c816067fb71a8dec429e77cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11

// Low Battery Level
// Enable a developer to remove CPU intensive CSS/JS when battery is low
// developer.mozilla.org/en/DOM/window.navigator.mozBattery
// By: Paul Sayre

Modernizr.addTest('lowbattery', function () {
	var minLevel = 0.20,
		battery = Modernizr.prefixed('battery', navigator);
	return !!(battery && !battery.charging && battery.level <= minLevel);
});