Skip to content

Commit

Permalink
use accessibility-developer-tools instead of vendor version
Browse files Browse the repository at this point in the history
  • Loading branch information
philschatz committed Sep 28, 2016
1 parent 9d0c980 commit d3e361c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2,287 deletions.
8 changes: 6 additions & 2 deletions lib/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Eval = require('./eval')

exports.audit = () => {
return Eval.execute(function () {
const {axs} = window.__devtron
const {axs} = window
const config = new axs.AuditConfiguration({showUnsupportedRulesWarning: false})
const results = axs.Audit.run(config)

Expand Down Expand Up @@ -33,8 +33,12 @@ exports.audit = () => {
title: result.rule.heading,
url: result.rule.url,
elements: elements.map(function (element) {
let selector = element.tagName.toLowerCase()
if (element.className) {
selector += '.' + element.className.split(' ').join('.')
}
return {
selector: window.__devtron.axs.utils.getQuerySelectorText(element),
selector: selector,
id: element.__accessibilityAuditId
}
})
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"content_scripts": [
{
"matches": ["*"],
"js": ["vendor/axs.js"]
"js": ["node_modules/accessibility-developer-tools/dist/js/axs_testing.js"]
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"watchify": "^3.7.0"
},
"dependencies": {
"accessibility-developer-tools": "^2.11.0",
"highlight.js": "^9.3.0",
"humanize-plus": "^1.8.1"
},
Expand Down
Loading

0 comments on commit d3e361c

Please sign in to comment.