Skip to content

Instantly share code, notes, and snippets.

@vladimyr
Created October 19, 2017 00:24
Show Gist options
  • Save vladimyr/7e2ea26f7ffdf520dc18eedd6610abc2 to your computer and use it in GitHub Desktop.
Save vladimyr/7e2ea26f7ffdf520dc18eedd6610abc2 to your computer and use it in GitHub Desktop.
accessiblityjs bookmarklet
(function() {
var script = document.createElement('script');
script.src = '//unpkg.com/accessibilityjs@1.0.1/dist/index-umd.js';
document.body.appendChild(script);
function logError(error) {
error.element.style.outline = '5px solid red';
error.element.addEventListener('click', function (e) {
alert([error.name, error.message].join('\n'));
e.stopPropagation();
e.preventDefault();
}, {once: true});
}
script.onload = function() {
accessibilityjs.scanForProblems(document, logError);
};
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment