Skip to content

Commit

Permalink
Merge pull request #290 from GSA/a11y-update
Browse files Browse the repository at this point in the history
Pass window.document to HTMLCS instead of document.documentElement
  • Loading branch information
akuny authored Dec 5, 2023
2 parents 6d9b12b + 2977d7f commit b1de788
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/core-scanner/src/pages/accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ async function getHtmlcsResults(
): Promise<Message[] | undefined> {
try {
return (await page.evaluate(() => {
const windowGlobal = window as any;

return new Promise((resolve, reject) => {
HTMLCS.process('WCAG2AA', document.documentElement, () => {
HTMLCS.process('WCAG2AA', windowGlobal.document, () => {
try {
resolve(HTMLCS.getMessages());
} catch (err) {
Expand Down

0 comments on commit b1de788

Please sign in to comment.