battery.js 662 B

1234567891011121314151617181920
  1. /*!
  2. {
  3. "name": "Battery API",
  4. "property": "batteryapi",
  5. "aliases": ["battery-api"],
  6. "builderAliases": ["battery_api"],
  7. "tags": ["device", "media"],
  8. "authors": ["Paul Sayre", "Alex Bradley (@abrad1212)"],
  9. "notes": [{
  10. "name": "MDN Docs",
  11. "href": "https://developer.mozilla.org/en/DOM/window.navigator.mozBattery"
  12. }]
  13. }
  14. !*/
  15. /* DOC
  16. Detect support for the Battery API, for accessing information about the system's battery charge level.
  17. */
  18. define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
  19. Modernizr.addTest('batteryapi', !!prefixed('battery', navigator) || !!prefixed('getBattery', navigator), {aliases: ['battery-api']});
  20. });