[epiphany] Revert "webapp: Open links to the same base domain inside the web app"



commit b0e07d412d1e11613f313cf9e5a59610eb6b98da
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Oct 12 08:05:35 2016 -0500

    Revert "webapp: Open links to the same base domain inside the web app"
    
    This reverts commit 0b4464039e0e1175abd0f90e2700631991d643c0.
    
    I don't know what website this change was made for, nor do I have a good
    solution to make web apps work with that unfortunate website, but I have
    my own web app where this behavior is confusing and unexpected.
    Different domains are treated as completely unrelated by web browsers,
    and web apps should not be any exception. At any rate, this is the wrong
    place for the check too, as it results in URLs with different origins
    being reported to have the same origin.
    
    I really don't know if the original problem can be fixed properly or
    not, but hopefully the login page link would be opened in a related view
    and a heuristic could be developed based on that.

 embed/ephy-embed-utils.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 026eb8a..7782a7b 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -328,26 +328,12 @@ ephy_embed_utils_urls_have_same_origin (const char *a_url,
     return retval;
 
   b_uri = soup_uri_new (b_url);
-  if (!b_uri) {
-    soup_uri_free (a_uri);
-    return retval;
-  }
-
-  if (a_uri->host && b_uri->host) {
-    retval = soup_uri_host_equal (a_uri, b_uri);
-    if (!retval) {
-      const char *a_domain;
-      const char *b_domain;
-
-      a_domain = soup_tld_get_base_domain (a_uri->host, NULL);
-      b_domain = soup_tld_get_base_domain (b_uri->host, NULL);
-
-      retval = a_domain && b_domain && strcmp (a_domain, b_domain) == 0;
-    }
+  if (b_uri) {
+    retval = a_uri->host && b_uri->host && soup_uri_host_equal (a_uri, b_uri);
+    soup_uri_free (b_uri);
   }
 
   soup_uri_free (a_uri);
-  soup_uri_free (b_uri);
 
   return retval;
 }


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