Verified Commit 2020539d authored by ma1's avatar ma1 Committed by Pier Angelo Vendrame
Browse files

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

parent 9e3028ef
Loading
Loading
Loading
Loading
+13 −0
Changes for browser/components/onionservices/content/authPrompt.js: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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) {