Chrome Accessibility Tree Viewer is used to check how web page elements are parsed by screen readers, helping to discover problems such as missing tags, wrong roles, etc. 1. After opening DevTools, select the element in the Elements panel and view it in the Accessibility panel under the Computed tab; 2. Click "Show accessibility tree" to view the accessibility structure of the entire page; 3. Elements with only accessibility semantics will appear in the accessibility tree, such as div, input, h1-h6, a, etc. with role or aria-label; 4. Pay attention to whether the role, name, status and attributes are correct when checking, such as ensuring that the button has aria-label to avoid misuse of the role; 5. You can combine Lighthouse for overall accessibility scoring and analysis.
Chrome's Accessibility Tree Viewer is a very practical developer tool that can help you see how elements in web pages are parsed and presented by assistive technologies such as screen readers. It can help you quickly discover accessibility issues, such as missing tags, wrong roles or incomplete attributes.

Open Accessible Tree Viewer
First, you need to open Chrome Developer Tools (DevTools), you can select "Check" anywhere by right-clicking the page, or use the shortcut keys F12
or Ctrl Shift I
( Cmd Option I
on Mac).
Next, select a DOM element in the Elements panel, and then find the Computed tab on the right, and you will see a panel called Accessibility at the bottom. After clicking on it, you can see the performance of this element in the barrier-free tree.

If you want to see the accessibility structure of the entire page more clearly, you can click the "Show accessibility tree" button in the Accessibility panel, which will display the accessibility node level of the entire page.
Understand the structure of the accessibility tree
Accessibility trees are similar to DOM trees, but not all DOM nodes appear in the accessibility trees. Only those elements with accessible semantics (such as role, label, state, etc.) will be included.

For example:
- A
<div> will not appear in the barrier-free tree by default<li> <code><div> with <code>role="button"
oraria-label
will be included - Form controls such as
<input>
, title<h1></h1>
to<h6></h6>
, link<a></a>
, etc. usually appear in the accessibility tree. - Elements do not appear in the accessibility tree : it may be the lack of necessary semantic tags or interactive features. Consider adding
tabindex
,role
oraria-label
. - Name (name) is empty : This causes the screen reader to not correctly describe the element's purpose. Make sure to use
aria-label
,aria-labelledby
or text content to provide the name. - Role is not suitable : for example,
role="heading"
is used to simulate the title but not set the correct level. Try to use native HTML tags, or make sure the ARIA role is used properly. - State and attributes are missing : For example, whether the button is disabled, whether the check box is selected, etc., states should be clearly expressed through the ARIA attribute.
When viewing, you can see the role, name, states, and properties of each node. This information is very important for understanding how users perceive content through screen reading software.
FAQs and Inspection Suggestions
Here are some issues you may encounter when using the Accessible Tree Viewer, as well as the corresponding checking methods:
For example: If you have an icon button and only use <span class="icon"></span>
, it will not appear in the barrier-free tree by default. You need to add properties like role="button"
and aria-label="關(guān)閉"
to allow the screen reader to recognize its function.
Combined with Lighthouse for comprehensive evaluation
In addition to directly viewing the accessibility tree, you can also use the Lighthouse feature in Chrome DevTools to do a comprehensive accessibility score.
After entering DevTools, click the Lighthouse tab and check "Accessibility". After running the test, you will get a detailed report, including suggestions for multiple dimensions such as contrast, keyboard navigation, and ARIA usage.
This approach is more suitable for overall assessment of website accessibility levels, while the Accessibility Tree Viewer is more suitable for troubleshooting specific elements one by one.
Basically that's it. Proficiency in using the Accessibility Tree Viewer can help you locate and fix accessibility issues hidden in web pages faster. Although it seems a bit technical, you can get started soon by just looking at common patterns.
The above is the detailed content of How to use Chrome's accessibility tree viewer. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To prevent Chrome from automatically updating on Mac, it can be done by disabling update services, modifying permissions, and restricting network access. 1. Use terminal commands to disable the GoogleSoftwareUpdate daemon to prevent background updates; 2. Modify update directory permissions to prevent Chrome from starting the update process by itself; 3. Restrict Chrome's outbound network connection through system firewall or third-party tools to further eliminate update requests. Using these methods in combination can effectively prevent Chrome from being automatically updated.

When Chrome spelling check fails, you can troubleshoot and fix it by following the following steps: 1. Confirm that the "Use Spelling Check" function is enabled and check whether the corresponding language is enabled in the language settings; 2. Adjust the input language order, delete the redundant language, and ensure that the main language enables spelling check; 3. Close possible conflicting extensions, especially syntax or translation plug-ins; 4. Update Chrome to the latest version and check the operating system updates. If it still doesn't work, try resetting Chrome settings.

To clear the HSTS cache in Chrome, visit the chrome://net-internals/#hsts page, find the "Deletedomainssecuritypolicies" section, enter the target domain name and click "Delete". 1. Open Chrome's HSTS management page; 2. Enter the domain name in "Deletedomainsecuritypolicies" and delete it; 3. Test whether it is successful and try to access the website through http://. Note: This operation only deletes the HSTS rules for specific domain names. If you revisit the website via HTTPS, the browser may enable HSTS again. For inaccessible

To let Chrome download directly instead of opening it when clicking on the PDF link, 1. Enter chrome://settings/content/pdfDocuments to check "DownloadPDFfilesinsteadofautomatically opening theminChrome"; 2. Check whether there are plug-ins such as Lightpdf or Smallpdf interfering behavior, you can try to disable the test; 3. You can use the developer tools to copy the link and paste the new tag to trigger the download. The above methods can be selected according to the situation.

The problem of Chrome automatically popping up new tabs is usually caused by malicious extensions, advertising scripts, or browser hijacking. The solutions are as follows: 1. Check and uninstall suspicious extensions, especially ad-class plug-ins; 2. Clear browser caches and cookies to eliminate data corruption; 3. Check whether the homepage and default search engine settings have been tampered with and manually corrected; 4. Use antivirus software such as WindowsDefender or Malwarebytes to scan and clear potential malware; 5. Finally, try resetting Chrome settings to restore the default configuration. Troubleshooting in this order can effectively solve most abnormal labeling problems.

The screen tear occurs when the Chrome browser scrolls, which is usually caused by the out-of-synchronization of rendering and refresh. The solutions are as follows: 1. Ensure that hardware acceleration is enabled, you can manually check the settings and restart the browser; 2. Forcefully enable Compositor and related options to optimize rendering; 3. Check the display refresh rate, use single-screen testing, and enable VSync or adaptive synchronization technology on supported devices; 4. Update the graphics card driver or replace the display interface such as using the DP interface. It is recommended to start the troubleshooting with simple steps and gradually adjust to find the best configuration.

The problem of Chrome sync stuck can be solved through the following steps: 1. Check the network connection and Google account status to ensure normal access; 2. Log out and log in to the Chrome account again; 3. Clear the synchronized data and restart the browser; 4. Reset Chrome settings; 5. Try the traceless mode or new user profile. Sequentially checking can effectively restore the synchronization function.

1. Check whether the shortcut attribute has additional parameters and delete it; 2. Clear cache and switch startup settings, or create new user information; 3. Extend the impact and disable the problem plug-in through traceless mode. Chrome pops up new windows instead of tabs usually due to exceptions in shortcut parameters, cache configuration conflicts, or third-party extension interference. Check and adjust the corresponding settings in turn to resolve.
