Skip to content
Snippets Groups Projects
Commit 4a13c283 authored by ma1's avatar ma1 Committed by ma1
Browse files

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

parent 9d876ebb
1 merge request!691Bug 41856: force focus back to the onion service authorization popup when clicked
...@@ -73,8 +73,18 @@ const OnionAuthPrompt = (function() { ...@@ -73,8 +73,18 @@ const OnionAuthPrompt = (function() {
); );
}, },
_autoFocus(event) {
event.target.ownerGlobal.focus();
},
_onPromptShowing(aWarningMessage) { _onPromptShowing(aWarningMessage) {
let xulDoc = this._browser.ownerDocument; 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); let descElem = xulDoc.getElementById(OnionAuthUtil.domid.description);
if (descElem) { if (descElem) {
// Handle replacement of the onion name within the localized // Handle replacement of the onion name within the localized
...@@ -159,6 +169,9 @@ const OnionAuthPrompt = (function() { ...@@ -159,6 +169,9 @@ const OnionAuthPrompt = (function() {
this._boundOnKeyFieldInput = undefined; this._boundOnKeyFieldInput = undefined;
} }
} }
if (this._popupElem) {
this._popupElem.removeEventListener("click", this._autoFocus);
}
}, },
_onKeyFieldKeyPress(aEvent) { _onKeyFieldKeyPress(aEvent) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment