[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.1.0esr-14.0-1] fixup! Bug 40701: Add security warning when downloading a file

morgan (@morgan) git at gitlab.torproject.org
Thu Aug 15 19:15:38 UTC 2024



morgan pushed to branch tor-browser-128.1.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
7b9fe534 by Henry Wilkes at 2024-08-15T19:03:15+00:00
fixup! Bug 40701: Add security warning when downloading a file

Bug 42642: Focus the "Got it" button when opening the downloads panel.

This should ensure that the alert is read aloud by Orca screen reader.

- - - - -


1 changed file:

- browser/components/downloads/content/downloads.js


Changes:

=====================================
browser/components/downloads/content/downloads.js
=====================================
@@ -107,11 +107,12 @@ var DownloadsPanel = {
         if (Services.prefs.getBoolPref(PREF_SHOW_DOWNLOAD_WARNING)) {
           torWarningMessage.hidden = false;
         } else {
-          // Re-assign focus if it is about to be lost.
-          if (torWarningMessage.contains(document.activeElement)) {
+          const hadFocus = torWarningMessage.contains(document.activeElement);
+          torWarningMessage.hidden = true;
+          // Re-assign focus that was lost.
+          if (hadFocus) {
             this._focusPanel(true);
           }
-          torWarningMessage.hidden = true;
         }
       };
       Services.prefs.addObserver(
@@ -577,6 +578,20 @@ var DownloadsPanel = {
     if (this._preventFocusRing) {
       focusOptions.focusVisible = false;
     }
+
+    // Focus the "Got it" button if it is visible.
+    // This should ensure that the alert is read aloud by Orca when the
+    // downloads panel is opened. See tor-browser#42642.
+    const torWarningMessage = document.getElementById(
+      "downloadsPanelTorWarning"
+    );
+    if (!torWarningMessage.hidden) {
+      torWarningMessage
+        .querySelector(".downloads-tor-warning-dismiss-button")
+        .focus(focusOptions);
+      return;
+    }
+
     if (DownloadsView.richListBox.itemCount > 0) {
       if (DownloadsView.canChangeSelectedItem) {
         DownloadsView.richListBox.selectedIndex = 0;



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/7b9fe534cfccc1a38eeeb8fc8ce783b24d0d3cd7

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/7b9fe534cfccc1a38eeeb8fc8ce783b24d0d3cd7
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240815/089e3fbf/attachment-0001.htm>


More information about the tor-commits mailing list