[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tor-cvs
Subject:    [tor-commits] [tor-browser] 73/74: fixup! Bug 21952: Implement Onion-Location
From:       gitolite role <git () cupani ! torproject ! org>
Date:       2022-04-27 20:17:59
Message-ID: 20220427201655.92AE510068F () cupani ! torproject ! org
[Download RAW message or body]

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

richard pushed a commit to branch tor-browser-91.9.0esr-11.0-1
in repository tor-browser.

commit 43429bcea122d9e9dd86f195104237f2d3e1b01d
Author: Pier Angelo Vendrame <pierov@torproject.org>
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@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic