diff --git a/lib/metadata/policies.js b/lib/metadata/policies.js index 9c7b9e2..40a1b38 100644 --- a/lib/metadata/policies.js +++ b/lib/metadata/policies.js @@ -1075,7 +1075,7 @@ var policies = { "hiddenImages": { "tool": "phantomas", "label": "Hidden images", - "message": "

List of all images that have a display:none property, or one of their parents. These images are loaded by the browser even if they're not visible. You might be able to find a way to lazy-load them, only when they get visible.

Trackers are an exception, you'd better hide them.

", + "message": "

List of all images that have a display:none property, or one of their parents. These images are loaded by the browser even if they're not visible. You might be able to find a way to lazy-load them, only when they get visible.

As images displayed in 1x1 pixels tend to be trackers, they are excluded from this rule.

", "isOkThreshold": 1, "isBadThreshold": 12, "isAbnormalThreshold": 30, diff --git a/lib/tools/phantomas/custom_modules/modules/domHiddenYLT/domHiddenYLT.js b/lib/tools/phantomas/custom_modules/modules/domHiddenYLT/domHiddenYLT.js index 097aef7..a90e2bf 100644 --- a/lib/tools/phantomas/custom_modules/modules/domHiddenYLT/domHiddenYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/domHiddenYLT/domHiddenYLT.js @@ -52,6 +52,8 @@ exports.module = function(phantomas) { if (src === '' || src.indexOf('data:image') === 0) continue; + if (images[i].width === 1 && images[i].height === 1) continue; + if (!lazyLoadableImages[src]) { path = phantomas.getDOMPath(images[i]);