morgan pushed to branch tor-browser-115.14.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits:
-
f3b141db
by Henry Wilkes at 2024-08-21T18:14:24+00:00
1 changed file:
Changes:
| ... | ... | @@ -128,11 +128,12 @@ var DownloadsPanel = { |
| 128 | 128 | if (Services.prefs.getBoolPref(PREF_SHOW_DOWNLOAD_WARNING)) {
|
| 129 | 129 | torWarningMessage.hidden = false;
|
| 130 | 130 | } else {
|
| 131 | - // Re-assign focus if it is about to be lost.
|
|
| 132 | - if (torWarningMessage.contains(document.activeElement)) {
|
|
| 131 | + const hadFocus = torWarningMessage.contains(document.activeElement);
|
|
| 132 | + torWarningMessage.hidden = true;
|
|
| 133 | + // Re-assign focus that was lost.
|
|
| 134 | + if (hadFocus) {
|
|
| 133 | 135 | this._focusPanel(true);
|
| 134 | 136 | }
|
| 135 | - torWarningMessage.hidden = true;
|
|
| 136 | 137 | }
|
| 137 | 138 | };
|
| 138 | 139 | Services.prefs.addObserver(
|
| ... | ... | @@ -597,6 +598,20 @@ var DownloadsPanel = { |
| 597 | 598 | if (this._preventFocusRing) {
|
| 598 | 599 | focusOptions.focusVisible = false;
|
| 599 | 600 | }
|
| 601 | + |
|
| 602 | + // Focus the "Got it" button if it is visible.
|
|
| 603 | + // This should ensure that the alert is read aloud by Orca when the
|
|
| 604 | + // downloads panel is opened. See tor-browser#42642.
|
|
| 605 | + const torWarningMessage = document.getElementById(
|
|
| 606 | + "downloadsPanelTorWarning"
|
|
| 607 | + );
|
|
| 608 | + if (!torWarningMessage.hidden) {
|
|
| 609 | + torWarningMessage
|
|
| 610 | + .querySelector(".downloads-tor-warning-dismiss-button")
|
|
| 611 | + .focus(focusOptions);
|
|
| 612 | + return;
|
|
| 613 | + }
|
|
| 614 | + |
|
| 600 | 615 | if (DownloadsView.richListBox.itemCount > 0) {
|
| 601 | 616 | if (DownloadsView.canChangeSelectedItem) {
|
| 602 | 617 | DownloadsView.richListBox.selectedIndex = 0;
|