MCPcopy Index your code
hub / github.com/hoothin/UserScripts / isElementVisible

Function isElementVisible

X-Downloader/X-Downloader.user.js:133–136  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

131 }
132 };
133 function isElementVisible(el) {
134 const rect = el.getBoundingClientRect();
135 return rect.top < window.innerHeight && rect.top > 0 && rect.bottom >= 0;
136 }
137 function findFirstVisibleElement(selector) {
138 const elements = document.querySelectorAll(selector);
139 const firstVisibleElement = Array.from(elements).find(el => {

Callers 2

findFirstVisibleElementFunction · 0.85
touchCheckFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected