pagevisibility-api.js 843 B

12345678910111213141516171819202122232425
  1. /*!
  2. {
  3. "name": "Page Visibility API",
  4. "property": "pagevisibility",
  5. "caniuse": "pagevisibility",
  6. "tags": ["performance"],
  7. "notes": [{
  8. "name": "MDN Docs",
  9. "href": "https://developer.mozilla.org/en-US/docs/DOM/Using_the_Page_Visibility_API"
  10. },{
  11. "name": "W3C Spec",
  12. "href": "https://www.w3.org/TR/2011/WD-page-visibility-20110602/"
  13. },{
  14. "name": "HTML5 Rocks Tutorial",
  15. "href": "https://www.html5rocks.com/en/tutorials/pagevisibility/intro/"
  16. }],
  17. "polyfills": ["visibilityjs", "visiblyjs", "jquery-visibility"]
  18. }
  19. !*/
  20. /* DOC
  21. Detects support for the Page Visibility API, which can be used to disable unnecessary actions and otherwise improve user experience.
  22. */
  23. define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
  24. Modernizr.addTest('pagevisibility', !!prefixed('hidden', document, false));
  25. });