Verified Commit e4ed3f35 authored by ma1's avatar ma1
Browse files

fixup! Bug 30237: Add v3 onion services client authentication prompt

Bug 42557: Fix regression in Onion Services authentication prompt focus
parent fc0ee191
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -81,8 +81,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(
        "tor-clientauth-notification"
      ))?.addEventListener("click", this._autoFocus);

      let descElem = xulDoc.getElementById("tor-clientauth-notification-desc");
      if (descElem) {
        // Handle replacement of the onion name within the localized
@@ -153,6 +163,7 @@ const OnionAuthPrompt = (function () {
          this._boundOnKeyFieldInput = undefined;
        }
      }
      this._popupElem?.removeEventListener("click", this._autoFocus);
    },

    _onKeyFieldKeyPress(aEvent) {