-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check for window object #2
Conversation
Felix, can you explain the scenario under which you would use the library without a window object? |
I am trying to make a gulp plugin to use the axel core in a project instead of with the tests. This way you can check the rules meanwhile you are developing some templates. If I use your library inside of my plugin (work in progress) when I launch my tests i have errors because the window object is not defined. My gulp plugin should read the source files from a source and pass to your library. Regards. |
The way the rules engine works is it evaluates the HTML code using the DOM APIs. None of the rules will work if there is no DOM. If there is a DOM, it must have CSS enabled for certain of the rules to work, I think what you are trying to do is not within the scope of what this library was designed to do. |
I try to load the source file and parse it as a DOM to pass to your function. This way I think is more easy to use during the development instead to configure the test. |
@felixzapata Instead of making this change, users who are doing what you are doing should add the following to their code base prior to calling the axe-core library
Then add the following to the end of the
Now you can require it as follows:
Note: the code was not intended to be run outside a browser, so we cannot guarantee the accuracy of the results if used this way. |
Well, thanks.. I will try to make some attempt. |
Implement first version of a plugin system
It checks the window object to avoid an undefined error when you use from a Node application.