Selaa lähdekoodia

filter interesting mutations only

Gildas 7 vuotta sitten
vanhempi
sitoutus
c85a794c25
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      lib/lazy/content/content-lazy-loader.js

+ 3 - 1
lib/lazy/content/content-lazy-loader.js

@@ -45,7 +45,9 @@ this.lazyLoader = this.lazyLoader || (() => {
 						if (mutation.attributeName == "src") {
 							mutation.target.setAttribute(LAZY_SRC_ATTRIBUTE_NAME, mutation.target.src);
 						}
-						return mutation.attributeName != LAZY_SRC_ATTRIBUTE_NAME && mutation.target.className != SINGLE_FILE_UI_ELEMENT_CLASS;
+						if (mutation.attributeName == "src" || mutation.attributeName == "srcset" || mutation.target.tagName == "SOURCE") {
+							return mutation.target.className != SINGLE_FILE_UI_ELEMENT_CLASS;
+						}
 					});
 					if (updated.length) {
 						srcAttributeChanged = true;