Skip to content

Commit 9774b32

Browse files
committed
Pandora: Label track options button and focus on first item of its drop-down.
1 parent 992a75a commit 9774b32

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

PandoraA11yFixes.user.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// @author James Teh <jamie@jantrid.net>
66
// @copyright 2013 James Teh
77
// @license GNU General Public License version 2.0
8-
// @version 0.20130111.01
8+
// @version 0.20130113.01
99
// @include http://www.pandora.com/*
1010
// @homepageURL http://userscripts.org/scripts/show/156173
1111
// @updateURL https://userscripts.org/scripts/source/156173.user.js
@@ -90,7 +90,7 @@ function onNodeAdded(target) {
9090

9191
function onStyleModified(target) {
9292
var style = target.style;
93-
if (target.id == "station_menu_dd" && style.visibility == "visible") {
93+
if ((target.id == "station_menu_dd" || target.id == "cd_menu_dd") && style.visibility == "visible") {
9494
var nodes = target.getElementsByTagName("a");
9595
for (var i = 0; i < nodes.length; ++i) {
9696
var node = nodes[i];
@@ -112,6 +112,10 @@ function init() {
112112
node.setAttribute("role", "button");
113113
node.setAttribute("aria-label", "Buy");
114114
}
115+
if (node = document.getElementsByClassName("cd_activator")[0]) {
116+
node.firstChild.setAttribute("role", "button");
117+
node.firstChild.setAttribute("aria-label", "Track options");
118+
}
115119
}
116120

117121
var observer = new MutationObserver(function(mutations) {

0 commit comments

Comments
 (0)