|
3 | 3 | // @namespace http://axSgrease.nvaccess.org/ |
4 | 4 | // @description Improves the accessibility of Apple Music. |
5 | 5 | // @author James Teh <jteh@mozilla.com> |
6 | | -// @copyright 2019-2020 Mozilla Corporation, Derek Riemer |
| 6 | +// @copyright 2019-2024 Mozilla Corporation, Derek Riemer |
7 | 7 | // @license Mozilla Public License version 2.0 |
8 | | -// @version 2020.1 |
| 8 | +// @version 2024.1 |
9 | 9 | // @include https://music.apple.com/* |
| 10 | +// @include https://beta.music.apple.com/* |
10 | 11 | // ==/UserScript== |
11 | 12 |
|
12 | 13 | /*** Functions for common tweaks. ***/ |
@@ -145,25 +146,22 @@ const DYNAMIC_TWEAK_ATTRIBS = []; |
145 | 146 |
|
146 | 147 | // Tweaks that must be applied whenever a node is added/changed. |
147 | 148 | const DYNAMIC_TWEAKS = [ |
148 | | - // Get rid of the svg inside the search combobox which prevents detection of |
149 | | - // the inner textbox with NVDA browse mode. |
150 | | - {selector: '.dt-search-box__icon', |
151 | | - tweak: makePresentational}, |
152 | | - // Make "Library" and "Playlists" headings. |
153 | | - {selector: '.web-navigation__header-text', |
154 | | - tweak: [makeHeading, 2]}, |
| 149 | + // Remove pointless semantics on a form inside the search box so screen |
| 150 | + // readers can find and focus the search box properly. |
| 151 | + {selector: '#search-input-form', |
| 152 | + tweak: el => { |
| 153 | + el.removeAttribute("tabindex"); |
| 154 | + el.setAttribute("role", "none"); |
| 155 | + }}, |
155 | 156 | // Make the section containing playback controls, etc. into a region. |
156 | | - {selector: '.web-chrome', |
157 | | - tweak: [makeRegion, "Controls"]}, |
158 | | - // Make the currently playing song title into a heading. |
159 | | - {selector: '.web-chrome-playback-lcd__song-name-scroll', |
160 | | - tweak: [makeHeading, 1]}, |
| 157 | + {selector: '.player-bar', |
| 158 | + tweak: el => el.setAttribute("role", "region")}, |
| 159 | + // Make the section containing the song info into a region. |
| 160 | + {selector: '[slot=lcd]', |
| 161 | + tweak: [makeRegion, "Info"]}, |
161 | 162 | // Fix cells in song lists. |
162 | | - {selector: '.col', |
| 163 | + {selector: '.songs-list__col', |
163 | 164 | tweak: el => el.setAttribute("role", "cell")}, |
164 | | - // The Add to library button for songs in song lists. |
165 | | - {selector: '.add-to-library', |
166 | | - tweak: [setLabel, "Add to library"]}, |
167 | 165 | // The title of an active radio station. |
168 | 166 | {selector: '.typography-large-title-emphasized', |
169 | 167 | tweak: [makeHeading, 1]}, |
|
0 commit comments