Client side accessibility error scanner.
Перейти к файлу
Mu-An ✌️ Chiou 15c493a296 Bump version to 1.0.1 2017-09-28 15:57:55 +08:00
.eslintrc Check with eslint 2017-06-27 16:39:50 +02:00
.gitignore Check with eslint 2017-06-27 16:39:50 +02:00
LICENSE Add license text 2017-06-26 23:42:08 +08:00
README.md Update browser support 2017-09-28 15:56:08 +08:00
index.js Move polyfill to test.html so people can use their own polyfillz 2017-09-28 15:28:40 +08:00
package.json Bump version to 1.0.1 2017-09-28 15:57:55 +08:00
test.html Move polyfill to test.html so people can use their own polyfillz 2017-09-28 15:28:40 +08:00

README.md

accessibilityjs

Client side accessibility error scanner.

Usage

import scanForProblems from 'accessibilityjs'

function logError(error, onPageWarning = true) {
  error.element.addEventListener('click', function () {
    alert(`${error.name}\n\n${error.message}`)
  }, {once: true})

  if (onPageWarning) error.element.classList.add('accessibility-error')
}

document.addEventListener('ready', function() {
  scanForProblems(document, logError)
})

Browser support

  • Chrome
  • Firefox
  • Safari 6+
  • Internet Explorer 9+
  • Microsoft Edge

Internet Explorer and Edge require a polyfill for closest.

Development

Test script changes with test.html.