Skip to content

Commit a0442d3

Browse files
committed
Use descendant instead of child, for cases like a > div > img
1 parent d024a66 commit a0442d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content-script.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ Repaginator.prototype = {
225225
return;
226226
}
227227

228-
// Second: see if it has a child with a @src we may use
229-
let srcEl = getFirstSnapshot(el.ownerDocument, el, "child::*[@src]");
228+
// Second: see if it has a descendant with a @src we may use
229+
let srcEl = getFirstSnapshot(el.ownerDocument, el, "descendant::*[@src]");
230230
if (srcEl) {
231231
let src = srcEl.getAttribute("src") || "";
232232
if (src.trim()) {
@@ -238,8 +238,8 @@ Repaginator.prototype = {
238238
}
239239
}
240240

241-
// Third: See if there is a child with a @value we may use
242-
srcEl = getFirstSnapshot(el.ownerDocument, el, "child::*[@value]");
241+
// Third: See if there is a descendant with a @value we may use
242+
srcEl = getFirstSnapshot(el.ownerDocument, el, "descendant::*[@value]");
243243
if (srcEl) {
244244
let val = srcEl.getAttribute("value") || "";
245245
if (val.trim()) {

0 commit comments

Comments
 (0)