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

Commits:

1 changed file:

Changes:

  • browser/components/onionservices/content/authPrompt.js
    ... ... @@ -73,8 +73,18 @@ const OnionAuthPrompt = (function() {
    73 73
           );
    
    74 74
         },
    
    75 75
     
    
    76
    +    _autoFocus(event) {
    
    77
    +      event.target.ownerGlobal.focus();
    
    78
    +    },
    
    79
    +
    
    76 80
         _onPromptShowing(aWarningMessage) {
    
    77 81
           let xulDoc = this._browser.ownerDocument;
    
    82
    +
    
    83
    +      // Force back focus: tor-browser#41856
    
    84
    +      (this._popupElem = xulDoc.getElementById(
    
    85
    +        `${OnionAuthUtil.domid.notification}-notification`
    
    86
    +      ))?.addEventListener("click", this._autoFocus);
    
    87
    +
    
    78 88
           let descElem = xulDoc.getElementById(OnionAuthUtil.domid.description);
    
    79 89
           if (descElem) {
    
    80 90
             // Handle replacement of the onion name within the localized
    
    ... ... @@ -159,6 +169,9 @@ const OnionAuthPrompt = (function() {
    159 169
               this._boundOnKeyFieldInput = undefined;
    
    160 170
             }
    
    161 171
           }
    
    172
    +      if (this._popupElem) {
    
    173
    +        this._popupElem.removeEventListener("click", this._autoFocus);
    
    174
    +      }
    
    162 175
         },
    
    163 176
     
    
    164 177
         _onKeyFieldKeyPress(aEvent) {