features.js 793 B

123456789101112131415161718192021222324252627282930
  1. var feature, supported = [], unsupported = [];
  2. phantom.injectJs('modernizr.js');
  3. console.log('Detected features (using Modernizr ' + Modernizr._version + '):');
  4. for (feature in Modernizr) {
  5. if (Modernizr.hasOwnProperty(feature)) {
  6. if (feature[0] !== '_' && typeof Modernizr[feature] !== 'function' &&
  7. feature !== 'input' && feature !== 'inputtypes') {
  8. if (Modernizr[feature]) {
  9. supported.push(feature);
  10. } else {
  11. unsupported.push(feature);
  12. }
  13. }
  14. }
  15. }
  16. console.log('');
  17. console.log('Supported:');
  18. supported.forEach(function (e) {
  19. console.log(' ' + e);
  20. });
  21. console.log('');
  22. console.log('Not supported:');
  23. unsupported.forEach(function (e) {
  24. console.log(' ' + e);
  25. });
  26. phantom.exit();