dequelabs / axe-webdriverjs

Provides a chainable axe API for Selenium's WebDriverJS and automatically injects into all frames.
Mozilla Public License 2.0
130 stars 46 forks source link

fix: Prevent infinitely recursing when injecting into iframes #66

Closed stephenmathieson closed 6 years ago

stephenmathieson commented 6 years ago

This patch prevents axe-webdriverjs from infinitely recursing when injecting axe-core into <iframe>s. I've re-written the code we use for injecting which will only recurse as deep as the number of nested <iframe>s on the page.

In order to keep the code "easy to read/write", I've used async/await rather than chaining Promises together. Because we do not have a clear picture of what Node.js versions we need to support here, I've added Babel in order to ensure async/await works in older Nodes. It is currently setup use support Node v4.

A test case has been added ensuring this solves the problem described in #63.

Closes #63.