Skip to content

Commit 3c47bd8

Browse files
committed
Initial import of BugzillaA11yFixes.
On Bugzilla bug pages, this makes the bug title, Attachments heading and comment number headings into headings for accessibility. This means that screen reader quick navigation can be used to jump between comments, etc.
1 parent 881d149 commit 3c47bd8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

BugzillaA11yFixes.user.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ==UserScript==
2+
// @name Bugzilla Accessibility Fixes
3+
// @namespace http://www.jantrid.net/axSGrease/
4+
// @description Improves the accessibility of Bugzilla.
5+
// @author James Teh <jamie@nvaccess.org>
6+
// @copyright 2014 James Teh
7+
// @license GNU General Public License version 2.0
8+
// @version 2014.1
9+
// @include */show_bug.cgi?*
10+
// ==/UserScript==
11+
12+
function makeHeading(elem, level) {
13+
elem.setAttribute("role", "heading");
14+
elem.setAttribute("aria-level", level);
15+
}
16+
17+
function tweak() {
18+
var elem = document.getElementById("short_desc_nonedit_display");
19+
if (!elem)
20+
return; // Not a Bugzilla bug.
21+
// Bug title.
22+
makeHeading(elem, 1);
23+
24+
// Attachments heading.
25+
if (elem = document.getElementById("attachment_table"))
26+
makeHeading(elem.rows[0].cells[0], 2);
27+
28+
// Comment numbers.
29+
for (elem of document.getElementsByClassName("bz_comment_number"))
30+
makeHeading(elem, 2);
31+
}
32+
33+
tweak();

0 commit comments

Comments
 (0)