简体   繁体   English

如何检查屏幕阅读器是否在html5应用程序中运行

[英]how to check screen reader is running in html5 application

I want to make my application accessible. 我想使我的应用程序可访问。

my application want to behave differently while screen reader is on and off 我的应用程序希望在屏幕阅读器打开和关闭时表现不同

for example : http://jsbin.com/pakiwuqa/6/edit 例如: http : //jsbin.com/pakiwuqa/6/edit

when screen-reader(jaws) is on #textContent should be in tabbing after #btn1 or #btn2, 当屏幕阅读器(下颌)在#textContent上时,应在#btn1或#btn2之后进行制表,

when screen-reader(jaws) is off #textContent should not be in tabbing 当屏幕阅读器(下颌)关闭时,#textContent不应处于制表位

is it possible to test that jaws is on or off using javascript ? 是否有可能使用javascript测试下颚是否打开或关闭

I think you misunderstand how a screen reader (SR) is supposed to work, you don't need to put #textContent in the tabbing order. 我认为您误解了屏幕阅读器(SR)的工作原理,您无需按制表顺序放置#textContent

If the SR user is browsing, they will likely read by using the arrow keys, and they will read through all the non-hidden content in source-code order (#textContent, item 1, item 2). 如果SR用户正在浏览,他们很可能会使用箭头键进行阅读,并且将按照源代码顺序(#textContent,项目1,项目2)阅读所有未隐藏的内容。 This is standard behaviour and useful, if it could not read the content apart from things you can tab to, it wouldn't be much of a reader. 这是标准行为,非常有用,如果它除了可以阅读的内容之外无法读取内容,则不会成为读者。

The role=application is oddly placed though, as that div does not contain any form controls, and might prevent some screen readers from reading #textContent . 但是role=application很奇怪,因为该div不包含任何表单控件,并且可能会阻止某些屏幕阅读器读取#textContent Application is a region, and should wrap a set of form controls or interactive widgets. 应用程序是一个区域,应包装一组表单控件或交互式小部件。 When inside a container marked as application , the page is supposed to handle key presses. 在标记为application的容器中时,该页面应该可以处理按键。

If the user is filling in a form, the SR will behave more how you are expecting, and they will skip the #textContent unless it is marked up as a <label> , you use aria-describedby , or they use the arrow keys. 如果用户正在填写表单,则SR将按照您的预期执行更多操作,并且他们将跳过#textContent除非将其标记为<label> ,使用#textContent aria-describedby或使用箭头键。

Lastly, there isn't a reliable way of detecting assistive technology on the web, and there are privacy concerns with that approach. 最后,没有一种可靠的方法来检测Web上的辅助技术,并且这种方法存在隐私问题 It may never be possible, plus when you factor in not everybody who has a disability uses a SR, you find you're better off building an accessible page/application versus hack. 这可能永远不可能,而且当您考虑到并非每个残障人士都使用SR时,您会发现自己最好构建可访问的页面/应用程序而不是黑客。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM