Skip to content

Commit 640f437

Browse files
committed
Apple Music: Update for changes to Apple Music.
1 parent e2745a2 commit 640f437

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

AppleMusicA11yFixes.user.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
// @namespace http://axSgrease.nvaccess.org/
44
// @description Improves the accessibility of Apple Music.
55
// @author James Teh <jteh@mozilla.com>
6-
// @copyright 2019-2020 Mozilla Corporation, Derek Riemer
6+
// @copyright 2019-2024 Mozilla Corporation, Derek Riemer
77
// @license Mozilla Public License version 2.0
8-
// @version 2020.1
8+
// @version 2024.1
99
// @include https://music.apple.com/*
10+
// @include https://beta.music.apple.com/*
1011
// ==/UserScript==
1112

1213
/*** Functions for common tweaks. ***/
@@ -145,25 +146,22 @@ const DYNAMIC_TWEAK_ATTRIBS = [];
145146

146147
// Tweaks that must be applied whenever a node is added/changed.
147148
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+
}},
155156
// 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"]},
161162
// Fix cells in song lists.
162-
{selector: '.col',
163+
{selector: '.songs-list__col',
163164
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"]},
167165
// The title of an active radio station.
168166
{selector: '.typography-large-title-emphasized',
169167
tweak: [makeHeading, 1]},

0 commit comments

Comments
 (0)