Added itb_scroll
This commit is contained in:
@@ -13,9 +13,19 @@ class ScreenshotGenerator:
|
||||
def get_page_content(self) -> dict:
|
||||
script = """
|
||||
function processElement(element) {
|
||||
if (!element.offsetParent && element !== document.body) return null;
|
||||
|
||||
// Check if element is actually visible in viewport
|
||||
const rect = element.getBoundingClientRect();
|
||||
if (!element.offsetParent && element !== document.body) return null;
|
||||
if (rect.width === 0 || rect.height === 0) return null;
|
||||
|
||||
// Check if element is within viewport bounds
|
||||
const viewportWidth = window.innerWidth;
|
||||
const viewportHeight = window.innerHeight;
|
||||
if (rect.bottom < 0 || rect.top > viewportHeight ||
|
||||
rect.right < 0 || rect.left > viewportWidth) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const styles = window.getComputedStyle(element);
|
||||
|
||||
const text = Array.from(element.childNodes)
|
||||
|
||||
Reference in New Issue
Block a user