Skip to content

Instantly share code, notes, and snippets.

@mihai-vlc
Created October 23, 2022 07:59
Show Gist options
  • Save mihai-vlc/c0492591b181164b8b764bcf1a0d8a85 to your computer and use it in GitHub Desktop.
Save mihai-vlc/c0492591b181164b8b764bcf1a0d8a85 to your computer and use it in GitHub Desktop.
(function() {
// restore the native console object
var i = document.createElement('iframe');
i.style.display = 'none';
document.body.appendChild(i);
window.console = i.contentWindow.console;
var script = document.createElement("script");
script.src = "https://unpkg.com/axe-core@4.4.3/axe.min.js";
script.onload = function () {
axe
.run()
.then(results => {
console.error("results violations", results.violations)
})
.catch(err => {
console.error('Error:', err.message);
});
};
document.head.appendChild(script);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment