'Download all images' button (#765)

* Use standard DOM function

* Add 'download all images' button

---------

Co-authored-by: cmdr2 <secondary.cmdr2@gmail.com>
This commit is contained in:
JeLuF
2023-02-14 15:03:25 +01:00
committed by GitHub
parent 2eb317c6b6
commit 9d1dd09a07
4 changed files with 19 additions and 13 deletions

View File

@ -20,19 +20,6 @@ function getNextSibling(elem, selector) {
}
}
function findClosestAncestor(element, selector) {
if (!element || !element.parentNode) {
// reached the top of the DOM tree, return null
return null;
} else if (element.parentNode.matches(selector)) {
// found an ancestor that matches the selector, return it
return element.parentNode;
} else {
// continue searching upwards
return findClosestAncestor(element.parentNode, selector);
}
}
/* Panel Stuff */