--axtree-only-visible
- CLI
- --axtree-only-visible
Leaves out of the accessibility tree what a person cannot see. Applies to axtree and axtree_json output and to --axtree.
Hidden Content
An element is left out, with everything it contains, when it is hidden by opacity: 0, clipped away by clip or clip-path, shrunk inside a box that clips its overflow, or placed off the page.
Default
Without this flag the tree keeps these elements, as a screen reader reads them: a skip link or screen-reader text is part of the page’s accessibility. With it, the tree is what the navigator is offered.
Example
zshot -f page.axtree.txt \
--axtree-only-visible \
https://zshot-cli.com/example_assets/gazette/{
"url": "https://zshot-cli.com/example_assets/gazette/",
"output_type": "axtree",
"axtree_only_visible": true
}curl -X POST http://127.0.0.1:3000/ \
-H "Content-Type: application/json" \
-d '{"url":"https://zshot-cli.com/example_assets/gazette/","output_type":"axtree","axtree_only_visible":true}' \
-o page.axtree.txt