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

Function tooltipTriggers

graph-ui/tools/lib/readability.mjs:709–741  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

707 * Bericht ueber ihn waere ein Bericht ueber einen Bildschirm, den es nicht gibt.
708 */
709export async function tooltipTriggers(page) {
710 return page.evaluate(() => {
711 const out = [];
712 let index = 0;
713 for (const node of document.querySelectorAll('[data-hint]')) {
714 const rect = node.getBoundingClientRect();
715 const style = window.getComputedStyle(node);
716 const seen = rect.width > 0 && rect.height > 0
717 && style.display !== 'none' && style.visibility !== 'hidden'
718 && Number(style.opacity) >= 0.05
719 && rect.bottom > 0 && rect.top < window.innerHeight
720 && rect.right > 0 && rect.left < window.innerWidth;
721 node.setAttribute('data-hint-index', String(index));
722 if (seen) {
723 out.push({
724 index,
725 name: node.getAttribute('data-hint-name') ?? '',
726 text: node.getAttribute('data-hint') ?? '',
727 tag: node.tagName.toLowerCase(),
728 focusable: node.tabIndex >= 0,
729 rect: {
730 x: Math.round(rect.x),
731 y: Math.round(rect.y),
732 width: Math.round(rect.width),
733 height: Math.round(rect.height),
734 },
735 });
736 }
737 index += 1;
738 }
739 return out;
740 });
741}
742
743/**
744 * Einen Tooltip oeffnen und messen, was er verdeckt.

Callers 2

sweepTooltipsFunction · 0.90
mainFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected