ie8compat.js 558 B

123456789101112131415161718
  1. /*!
  2. {
  3. "name": "IE8 compat mode",
  4. "property": "ie8compat",
  5. "authors": ["Erich Ocean"]
  6. }
  7. !*/
  8. /* DOC
  9. Detects whether or not the current browser is IE8 in compatibility mode (i.e. acting as IE7).
  10. */
  11. define(['Modernizr'], function(Modernizr) {
  12. // In this case, IE8 will be acting as IE7. You may choose to remove features in this case.
  13. // related:
  14. // james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/
  15. Modernizr.addTest('ie8compat', (!window.addEventListener && !!document.documentMode && document.documentMode === 7));
  16. });