Skip to content

Truly independent web browser

745 B
Raw Blame
<!DOCTYPE html>
<script src="include.js"></script>
<div style="display:none">Hidden by CSS <button>Hidden button</button></div>
<p hidden>Hidden by attribute</p>
<p>Visible text</p>
<script>
    test(() => {
        const dump = (node, depth) => {
            const name = node.role === "text leaf" ? ` ${JSON.stringify(node.name)}` : node.name ? ` "${node.name}"` : "";
            const description = node.description ? ` description="${node.description}"` : "";
            println(`${"  ".repeat(depth)}${node.role || "(no role)"}${name}${description}`);
            for (const child of node.children ?? [])
                dump(child, depth + 1);
        };
        dump(JSON.parse(internals.dumpAccessibilityTree()), 0);
    });
</script>