dequelabs / dequelabs/axe-core

Add method for detecting native method overrides

Open
#3,890 0 comments 0 reactions 0 assignees View on GitHub
core feat
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

A fairly common issue people experience running axe-core is that it fails because somewhere in their code they modified some native JavaScript or DOM object. To be able to find these issues more easily it would be great if axe-core could detect these problems.

This might look something like:

```js
console.log( axe.utils.findJsOverrides() );
// ['Array.prototype.some', 'JSON.stringify'];
```

This should only return truely native methods. So if someone added a `NodeList.prototype.toArray()` method, that shouldn't be picked up, since that's irrelevant for axe. I'm not sure whether we should generate such a list at build time, which we can do with `Object.keys(JSON /*... and others */)`, or if we should manually curate a list. Maintaining a list by hand would let us be even more selective, and so return less noise, but we'd need to figure out a way to keep it up to date.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.