Open jasonhocker opened 3 months ago
Thanks for the issue. I can't reproduce the issue though. Running the code inside it's own bock doesn't reproduce the issue and I can't run it outside of it's own block because I can't override document
.
(async () => {
let parser = new DOMParser();
const html2 = '<html lang="en-US"><head><title>Deque test</title></head><body></body></html>';
let document = parser.parseFromString(html2, "text/html");
const results = await axe.run(document, {
runOnly: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']
})
console.log(results) // violations is empty
})()
let parser = new DOMParser();
const html2 = '<html lang="en-US"><head><title>Deque test</title></head><body></body></html>';
// throws Uncaught SyntaxError: Identifier 'document' has already been declared
let document = parser.parseFromString(html2, "text/html");
I am trying to write a Chrome extension for my own internal purpose. I am trying to run axe-core inside devtools, passing the html from the content-script in certain situations and then scan in devtools using a DOMParser to hydrate the string I get from the messaging to pass to axe-core. Looks like the extension is doing its job, but for this test it was scanning the head of the html for the devtools panel. Once I added a title to that, this violation from axe-core went away, but I'm wondering what is not getting scanned that I expected to scan.
Product
axe-core
Product Version
4.9.1
Latest Version
Issue Description
Expectation
Describe what you expected the product to do.
Actual
Using axe-core npm package scanning some text and getting document-title violation though there is a
How to Reproduce
Additional context