ma1 pushed to branch tor-browser-102.12.0esr-12.5-1 at The Tor Project / 
Applications / Tor Browser


Commits:
4a13c283 by hackademix at 2023-06-27T07:54:52+00:00
fixup! Bug 30237: Add v3 onion services client authentication prompt

- - - - -


1 changed file:

- browser/components/onionservices/content/authPrompt.js


Changes:

=====================================
browser/components/onionservices/content/authPrompt.js
=====================================
@@ -73,8 +73,18 @@ const OnionAuthPrompt = (function() {
       );
     },
 
+    _autoFocus(event) {
+      event.target.ownerGlobal.focus();
+    },
+
     _onPromptShowing(aWarningMessage) {
       let xulDoc = this._browser.ownerDocument;
+
+      // Force back focus: tor-browser#41856
+      (this._popupElem = xulDoc.getElementById(
+        `${OnionAuthUtil.domid.notification}-notification`
+      ))?.addEventListener("click", this._autoFocus);
+
       let descElem = xulDoc.getElementById(OnionAuthUtil.domid.description);
       if (descElem) {
         // Handle replacement of the onion name within the localized
@@ -159,6 +169,9 @@ const OnionAuthPrompt = (function() {
           this._boundOnKeyFieldInput = undefined;
         }
       }
+      if (this._popupElem) {
+        this._popupElem.removeEventListener("click", this._autoFocus);
+      }
     },
 
     _onKeyFieldKeyPress(aEvent) {



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

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


_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to