Skip to content

Commit 6ccb2d7

Browse files
committed
GitHub: Remove table-related roles from release asset links
1 parent 640f437 commit 6ccb2d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

GitHubA11yFixes.user.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ const DYNAMIC_TWEAKS = [
163163
// Remove headings from folder and file lists.
164164
{selector: 'table[aria-labelledby=folders-and-files] :is(h2, h3)',
165165
tweak: makePresentational},
166+
// Remove table-related roles from release asset links.
167+
{selector: 'ul:not([role]):has(li[role="row"])',
168+
tweak: el => {
169+
// Add a list role, for future proofing in case GitHub double down on making these tables.
170+
el.setAttribute("role", "list");
171+
el.querySelectorAll('li[role="row"]').forEach(row => {
172+
row.removeAttribute("role");
173+
row.querySelectorAll('[role="cell"]').forEach(cell => cell.removeAttribute("role"));
174+
});
175+
}},
166176
];
167177

168178
/*** Lights, camera, action! ***/

0 commit comments

Comments
 (0)