辅助功能工具
打造无障碍应用至关重要,我们很高兴为 Devtron 和 Spectron 引入新功能,让开发者有机会让他们的应用更适合所有人。
¥Making accessible applications is important and we're happy to introduce new functionality to Devtron and Spectron that gives developers the opportunity to make their apps better for everyone.
Electron 应用中的可访问性问题与网站的可访问性问题类似,因为它们最终都是 HTML。然而,对于 Electron 应用,你无法使用在线资源进行可访问性审核,因为你的应用没有 URL 指向审核员。
¥Accessibility concerns in Electron applications are similar to those of websites because they're both ultimately HTML. With Electron apps, however, you can't use the online resources for accessibility audits because your app doesn't have a URL to point the auditor to.
这些新功能将这些审计工具引入你的 Electron 应用。你可以选择使用 Spectron 为你的测试添加审计,或者在 DevTools 中使用 Devtron 的审计功能。继续阅读工具摘要或查看我们的 无障碍文档 了解更多信息。
¥These new features bring those auditing tools to your Electron app. You can choose to add audits to your tests with Spectron or use them within DevTools with Devtron. Read on for a summary of the tools or checkout our accessibility documentation for more information.
Spectron
在测试框架 Spectron 中,你现在可以审核应用中的每个窗口和 <webview>
标签。例如:
¥In the testing framework Spectron, you can now audit each window and <webview>
tag in your application. For example:
app.client.auditAccessibility().then(function (audit) {
if (audit.failed) {
console.error(audit.message);
}
});
你可以在 Spectron 文档 中阅读有关此功能的更多信息。
¥You can read more about this feature in Spectron's documentation.
Devtron
Devtron 中有一个新的辅助功能选项卡,可让你审核页面在你的应用中,对结果进行排序和筛选。
¥In Devtron there is a new accessibility tab which will allow you to audit a page in your app, sort and filter the results.
这两个工具都使用了 Google 为 Chrome 构建的 辅助功能开发者工具 库。你可以了解更多关于此库在 代码库的 wiki 上使用的可访问性审核规则的信息。
¥Both of these tools are using the Accessibility Developer Tools library built by Google for Chrome. You can learn more about the accessibility audit rules this library uses on that repository's wiki.
如果你知道其他适用于 Electron 的优秀辅助工具,请通过拉取请求将它们添加到 无障碍文档。
¥If you know of other great accessibility tools for Electron, add them to the accessibility documentation with a pull request.