dequelabs / dequelabs/axe-core
Add method for detecting native method overrides
- 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
Assessment
This issue has not been assessed yet.