Compare commits
1
Commits
07cc65e889
..
next
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e52528f8b |
@@ -290,6 +290,7 @@ class Driver {
|
|||||||
`const el = document.querySelector(arguments[0]);
|
`const el = document.querySelector(arguments[0]);
|
||||||
if (document.readyState !== "complete" || !el) return false;
|
if (document.readyState !== "complete" || !el) return false;
|
||||||
if (el.closest(".hidden")) return false;
|
if (el.closest(".hidden")) return false;
|
||||||
|
if (getComputedStyle(el).visibility !== "visible") return false;
|
||||||
const r = el.getBoundingClientRect();
|
const r = el.getBoundingClientRect();
|
||||||
return r.width > 0 && r.height > 0;`,
|
return r.width > 0 && r.height > 0;`,
|
||||||
[selector],
|
[selector],
|
||||||
|
|||||||
@@ -348,6 +348,7 @@ async function visible(page, selector, timeout = 15000) {
|
|||||||
const el = document.querySelector(sel);
|
const el = document.querySelector(sel);
|
||||||
if (document.readyState !== "complete" || !el) return false;
|
if (document.readyState !== "complete" || !el) return false;
|
||||||
if (el.closest(".hidden")) return false;
|
if (el.closest(".hidden")) return false;
|
||||||
|
if (getComputedStyle(el).visibility !== "visible") return false;
|
||||||
const r = el.getBoundingClientRect();
|
const r = el.getBoundingClientRect();
|
||||||
return r.width > 0 && r.height > 0;
|
return r.width > 0 && r.height > 0;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user