3 ms·
> The user is already comfortable with the way their browser works, and you will fail to capture the subtle nuances of their user agent with your pretty imitat
by mwcampbell 6y ago
> The user is already comfortable with the way their browser works, and you will fail to capture the subtle nuances of their user agent with your pretty imitations.
Amen! One form of browser imitation that particularly annoys me is client-side page loading. This is where JavaScript code intercepts activation of links, loads the new page using XHR or the like, then updates the current DOM in-place. Yes, this gives web developers the opportunity to prefetch pages or do fancy animations. But the accessibility problem here is that there's no way for an implementation of this technique to signal to a screen reader that a page loaded just as if the browser itself had loaded the page. Yes, you can use an ARIA live region to make a screen reader read your own message when you've finished loading the page. But I want my screen reader to be in control of what it does when a new page loads, e.g. automatically reading the contents of the page, possibly in a user-configurable way. So I think it's better to let the browser just load the page.
- guntars 6y agoThat sounds like a problem with the accessibility APIs then. I'd imagine that the script that replaces the DOM in-place also uses History API to tell the browser that this is a new page. At that point the browser should announce that it's a new page and do whatever you've configured it to do, but I just tried it in ChromeVox and it doesn't.
- deleted 6y ago[deleted]
- ratww 6y agoThere are a few ways of making announcements in screen readers and handling SPA changes. I haven't tested them thoroughly, but had to implement a few aria alerts in a SPA. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions https://developer.mozilla.org/en-US/docs/Web/Accessibility/A... https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_alert_role https://developer.mozilla.org/en-US/docs/Web/Accessibility/A...
- marcusjt 6y agoNo JS is needed to prefetch resources that might be needed by the user in the future (e.g. the next navigation) because prefetch it's an HTML5 standard so let the browser handle it, see https://www.keycdn.com/blog/resource-hints https://www.keycdn.com/blog/resource-hints