DEV Community

Discussion on: Stay alert

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

One thing that doesn't get much of a mention with the removal of these three modals in cross-origin iframes is the accessibility impact. With accessibility being given such a low focus in web development courses and tutorials, I think it's a fairly safe assumption that a lot of new developers don't think too much about accessibility concerns.

I wrote about this impact a couple of days ago also. In short, current modals:

  • Prevent access to the content beneath, both from mouse clicks and via keyboard access
  • Move the focus to the modal and back to the content after they're closed, which is how screen readers can present them at the correct time in the users flow
  • They present themselves to assistive tech as their modal type, letting the user know what to expect
  • They completely halt the execution of Javascript, which prevents things from changing in the content beneath, which could cause a screen reader to read out content in a disjointed manner and confuse the user

Given that alert() is a single line call that does all of these things and the alternative is dozens of lines of code (and that's without being able to halt script execution which is effectively impossible with and code not under your full control), I think it's another safe assumption that things will be missed. The end result is a less accessible web because Chrome tried to tackle the wrong problem.

As their main stated reason was abuse leading to security concerns, then they should have attempted to tackle that. What they've done is the equivalent to bricking over all doors and windows of a house to prevent break-ins. Sure, it does as they intend, but the owner can no longer access their house except via the chimney.