[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] branch tor-browser-91.7.0esr-11.5-1 updated: fixup! Bug 21952: Implement Onion-Location



This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.7.0esr-11.5-1
in repository tor-browser.

The following commit(s) were added to refs/heads/tor-browser-91.7.0esr-11.5-1 by this push:
     new 627f63be97263 fixup! Bug 21952: Implement Onion-Location
627f63be97263 is described below

commit 627f63be97263b923b870d2f060ca8b4d90d34ec
Author: Pier Angelo Vendrame <pierov@xxxxxxxxxxxxxx>
AuthorDate: Fri Mar 11 17:58:13 2022 +0100

    fixup! Bug 21952: Implement Onion-Location
    
    Keep fragments in redirects, to fix #34366
---
 browser/components/onionservices/OnionLocationChild.jsm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/browser/components/onionservices/OnionLocationChild.jsm b/browser/components/onionservices/OnionLocationChild.jsm
index 9e00054ac56cb..23e1823f5a09a 100644
--- a/browser/components/onionservices/OnionLocationChild.jsm
+++ b/browser/components/onionservices/OnionLocationChild.jsm
@@ -4,6 +4,8 @@
 
 var EXPORTED_SYMBOLS = ["OnionLocationChild"];
 
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 class OnionLocationChild extends JSWindowActorChild {
   handleEvent(event) {
     this.onPageShow(event);
@@ -23,9 +25,16 @@ class OnionLocationChild extends JSWindowActorChild {
     if (aMessage.name == "OnionLocation:Refresh") {
       const doc = this.document;
       const docShell = this.docShell;
-      const onionLocationURI = doc.onionLocationURI;
+      let onionLocationURI = doc.onionLocationURI;
       const refreshURI = docShell.QueryInterface(Ci.nsIRefreshURI);
       if (onionLocationURI && refreshURI) {
+        const docUrl = new URL(doc.URL);
+        let onionUrl = new URL(onionLocationURI.asciiSpec);
+        // Keep consistent with Location
+        if (!onionUrl.hash && docUrl.hash) {
+          onionUrl.hash = docUrl.hash;
+          onionLocationURI = Services.io.newURI(onionUrl.toString());
+        }
         refreshURI.refreshURI(
           onionLocationURI,
           doc.nodePrincipal,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits