WIP new image analizis module in Phantomas

This commit is contained in:
Gaël Métais
2023-08-14 01:54:17 +02:00
parent 8e941233a0
commit c308850eb3
7 changed files with 117 additions and 61 deletions
+7
View File
@@ -47,6 +47,7 @@ var PhantomasWrapper = function() {
// Mandatory
'analyze-css': true,
'analyze-images': true,
'ignoreSslErrors': true, // until Phantomas 2.1
'ignore-ssl-errors': true // for Phantomas >= 2.2
};
@@ -80,6 +81,12 @@ var PhantomasWrapper = function() {
offenders: results.getAllOffenders()
};
// Special rules here
if (task.options.device !== 'phone') {
delete json.metrics.imagesExcessiveDensity;
delete json.offenders.imagesExcessiveDensity;
}
deferred.resolve(json);
}).
catch(res => {