MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / scrollState

Function scrollState

graph-ui/tools/smoke-w11b.mjs:601–626  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

599
600/** Wo jeder scrollbare Bereich steht. Wortgleich mit smoke-w9/w10/w11a. */
601const scrollState = (page) =>
602 page.evaluate(() => {
603 const regions = [];
604 for (const node of document.body.querySelectorAll('*')) {
605 if (node.closest('.monaco-editor') !== null) {
606 continue;
607 }
608 const style = globalThis.getComputedStyle(node);
609 const scrollsY = (style.overflowY === 'auto' || style.overflowY === 'scroll')
610 && node.scrollHeight > node.clientHeight + 1;
611 const scrollsX = (style.overflowX === 'auto' || style.overflowX === 'scroll')
612 && node.scrollWidth > node.clientWidth + 1;
613 if (!scrollsY && !scrollsX) {
614 continue;
615 }
616 regions.push({
617 name: node.getAttribute('data-testid')
618 ?? (node.getAttribute('class') ?? '').split(/\s+/).filter(Boolean)[0]
619 ?? node.tagName.toLowerCase(),
620 top: Math.round(node.scrollTop),
621 left: Math.round(node.scrollLeft),
622 hidden: Math.round(node.scrollHeight - node.clientHeight),
623 });
624 }
625 return { regions, atRest: regions.every((region) => region.top <= 1 && region.left <= 1) };
626 });
627
628// ------------------------------------------------------------ Klickstrecke ---
629

Callers 1

shootFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected