I have grepped our 76 public pages for accessibility before and found one h1 each, zero skip links and a toast region on every marketing page. A grep tells you what is in the HTML. It does not tell you what happens when somebody actually presses Tab, so this time I pressed Tab.
const tab = async ( ) => { await page . cdp ( "Input.dispatchKeyEvent" , { type : "rawKeyDown" , windowsVirtualKeyCode : 9 , key : "Tab" , code : "Tab" } ) ; await page . cdp ( "Input.dispatchKeyEvent" , { type : "keyUp" , windowsVirtualKeyCode : 9 , key : "Tab" , code : "Tab" } ) ; } ;
Enter fullscreen mode
Exit fullscreen mode
Worth knowing: CDP key events do move focus. They do not scroll. An earlier audit of mine tried to test arrow-key scrolling this way and window.scrollY never moved, so I assumed synthetic keys were useless for keyboard work.…