(img, fetchImg)
| 25661 | // ------------------- run ------------------------- |
| 25662 | |
| 25663 | function pretreatment(img, fetchImg) { |
| 25664 | if (img.removeAttribute) img.removeAttribute("loading"); |
| 25665 | if (img.nodeName.toUpperCase() != "IMG" || (!fetchImg && img.src && !img.srcset && !/^data/.test(img.src))) return; |
| 25666 | if (img.src && !/(^data|loading|lazy)/.test(img.src)) return; |
| 25667 | let src; |
| 25668 | tprules.find(function(rule, index, array) { |
| 25669 | try { |
| 25670 | src = rule.call(img); |
| 25671 | if (src) { |
| 25672 | return true; |
| 25673 | } |
| 25674 | } catch(err) { |
| 25675 | debug(err); |
| 25676 | } |
| 25677 | }); |
| 25678 | if (src) { |
| 25679 | img.src = src; |
| 25680 | } |
| 25681 | } |
| 25682 | |
| 25683 | function findPic(img){ |
| 25684 | var imgPN=img; |
no test coverage detected