This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.3.0esr-12.0-2 in repository tor-browser.
The following commit(s) were added to refs/heads/tor-browser-102.3.0esr-12.0-2 by this push: new 7be57d563a83 fixup! Bug 30237: Add v3 onion services client authentication prompt 7be57d563a83 is described below
commit 7be57d563a8374c10cfd79d163af04f803f1bfa3 Author: hackademix giorgio@maone.net AuthorDate: Fri Oct 14 16:12:58 2022 +0100
fixup! Bug 30237: Add v3 onion services client authentication prompt --- .../components/onionservices/content/authPrompt.js | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/browser/components/onionservices/content/authPrompt.js b/browser/components/onionservices/content/authPrompt.js index f9b92608ed65..889acc2c6f67 100644 --- a/browser/components/onionservices/content/authPrompt.js +++ b/browser/components/onionservices/content/authPrompt.js @@ -228,18 +228,27 @@ const OnionAuthPrompt = (function() { },
_onCancel() { - // Arrange for an error page to be displayed. + // Arrange for an error page to be displayed: + // we build a short script calling docShell.displayError() + // and we pass it as a data: URI to loadFrameScript(), + // which runs it in the content frame which triggered + // this authentication prompt. const failedURI = this._failedURI.spec; const errorCode = - this._reasonForPrompt === OnionAuthUtil.topic.clientAuthMissing - ? Cr.NS_ERROR_TOR_ONION_SVC_MISSING_CLIENT_AUTH - : Cr.NS_ERROR_TOR_ONION_SVC_BAD_CLIENT_AUTH; - - const io = `ChromeUtils.import("resource://gre/modules/Services.jsm").Services.io`; - this._browser.messageManager.loadFrameScript(`data:,${encodeURIComponent( - `docShell.displayLoadError(${errorCode}, ${io}.newURI(${JSON.stringify(failedURI)}), undefined, undefined);` + this._reasonForPrompt === OnionAuthUtil.topic.clientAuthMissing + ? Cr.NS_ERROR_TOR_ONION_SVC_MISSING_CLIENT_AUTH + : Cr.NS_ERROR_TOR_ONION_SVC_BAD_CLIENT_AUTH; + const io = + 'ChromeUtils.import("resource://gre/modules/Services.jsm").Services.io'; + + this._browser.messageManager.loadFrameScript( + `data:application/javascript,${encodeURIComponent( + `docShell.displayLoadError(${errorCode}, ${io}.newURI(${JSON.stringify( + failedURI + )}), undefined, undefined);` )}`, - false); + false + ); },
_getKeyElement() {