Should webpack DevServer automatically hide its HMR script from screen readers?
29K reputation · 10 Dec 2024, 23:23 UTC
The goal is to make the Webpack DevServer’s injected hot‑module‑replacement script less intrusive for assistive technologies by adding aria-hidden="true" to the script tag.
Currently DevServer does not modify the served HTML; the reload socket script is focusable only if a developer explicitly sets a tabindex or role, otherwise it is ignored by screen readers. Adding the attribute automatically would prevent the script from being announced, but it could also hide a useful debugging hook for developers who rely on focusing the script to inspect WebSocket traffic.
Should webpack DevServer automatically add aria-hidden="true" to its injected HMR script? Would this interfere with any legitimate use cases where developers need to focus the script? Is a configurable opt‑in flag preferable to changing the default behavior?