Skip to content

Commit aab604b

Browse files
committed
Twitter: Don't change the role, as doing so causes Gecko to lag.
1 parent 03a95d2 commit aab604b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

TwitterA11yFixes.user.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// @author James Teh <jamie@jantrid.net>
66
// @copyright 2011 James Teh
77
// @license GNU General Public License version 2.0
8-
// @version 0.20111210.03
8+
// @version 0.20111212.01
99
// @include https://twitter.com/*
1010
// @include http://twitter.com/*
1111
// ==/UserScript==
@@ -26,11 +26,10 @@ function onAttrModified(evt) {
2626
// Twitter doesn't use real focus for this, so screen readers don't know which tweet has focus.
2727
// Force real focus.
2828
lastFocusedTweet = target;
29-
if (!target.getAttribute("role")) {
29+
if (!target.getAttribute("tabindex")) {
3030
// Make the node focusable and accessible.
3131
target.setAttribute("tabindex", "-1");
32-
target.setAttribute("role", "listitem");
33-
target.setAttribute("aria-selected", "true");
32+
// Unfortunately, changing the role causes Gecko to lag.
3433
}
3534
var orig = target.getElementsByClassName("original-tweet")[0];
3635
target.setAttribute("aria-label", (

0 commit comments

Comments
 (0)