Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
REMitchell
GitHub Repository: REMitchell/python-crawling
Path: blob/master/6-Selenium/phantomjs/examples/features.js
164 views
1
var feature, supported = [], unsupported = [];
2
3
phantom.injectJs('modernizr.js');
4
console.log('Detected features (using Modernizr ' + Modernizr._version + '):');
5
for (feature in Modernizr) {
6
if (Modernizr.hasOwnProperty(feature)) {
7
if (feature[0] !== '_' && typeof Modernizr[feature] !== 'function' &&
8
feature !== 'input' && feature !== 'inputtypes') {
9
if (Modernizr[feature]) {
10
supported.push(feature);
11
} else {
12
unsupported.push(feature);
13
}
14
}
15
}
16
}
17
18
console.log('');
19
console.log('Supported:');
20
supported.forEach(function (e) {
21
console.log(' ' + e);
22
});
23
24
console.log('');
25
console.log('Not supported:');
26
unsupported.forEach(function (e) {
27
console.log(' ' + e);
28
});
29
phantom.exit();
30
31
32