diff --git a/resources/tester/test_device_audit.py b/resources/tester/test_device_audit.py index 062e788a3..7e16ea39f 100644 --- a/resources/tester/test_device_audit.py +++ b/resources/tester/test_device_audit.py @@ -121,13 +121,18 @@ AUDIT_JS = r""" } """ -# 데스크탑 배치 서명 — 보이는 요소 사각형(정수) · 순서대로 +# 데스크탑 배치 서명 — 화면 안에 보이는 요소 사각형(정수) · 순서대로. +# 잡음 빼기 = 움직이는 중(CSS 애니메이션 · 로딩 원)인 요소와 그 안 · 화면 밖(스크롤 아래 1px 흔들림) LAYOUT_JS = r""" () => { const rows = []; + const moving = new Set(document.getAnimations().map((a) => a.effect && a.effect.target).filter(Boolean)); + const isMoving = (el) => { for (let p = el; p; p = p.parentElement) if (moving.has(p)) return true; return false; }; for (const el of document.body.querySelectorAll('*')) { const r = el.getBoundingClientRect(); if (r.width < 1 || r.height < 1) continue; + if (r.bottom <= 0 || r.top >= innerHeight || r.right <= 0 || r.left >= innerWidth) continue; + if (isMoving(el)) continue; if (el.checkVisibility && !el.checkVisibility({ visibilityProperty: true })) continue; rows.push(`${el.tagName}|${Math.round(r.left)},${Math.round(r.top)},${Math.round(r.width)},${Math.round(r.height)}`); }