[epiphany] Remove ftp from ephy_embed_utils_address_has_web_scheme ()



commit eeff7107ffaed3f966cec026ac1a498a0be7c4d1
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Wed Nov 13 18:16:20 2019 +0100

    Remove ftp from ephy_embed_utils_address_has_web_scheme ()
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/517

 embed/ephy-embed-shell.c      | 31 -------------------------------
 embed/ephy-embed-utils.c      |  1 -
 tests/ephy-embed-utils-test.c |  1 -
 3 files changed, 33 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 12ce9c2a5..ce374f95a 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -905,32 +905,6 @@ ephy_resource_request_cb (WebKitURISchemeRequest *request)
     webkit_uri_scheme_request_finish_error (request, error);
 }
 
-static void
-ftp_request_cb (WebKitURISchemeRequest *request)
-{
-  g_autoptr (GDesktopAppInfo) app_info = NULL;
-  g_autoptr (GList) list = NULL;
-  g_autoptr (GError) error = NULL;
-  const char *uri;
-
-  uri = webkit_uri_scheme_request_get_uri (request);
-  g_app_info_launch_default_for_uri (uri, NULL, &error);
-
-  if (!error) {
-    g_signal_emit_by_name (webkit_uri_scheme_request_get_web_view (request), "close", NULL);
-    return;
-  }
-
-  /* Default URI handler didn't work. Try nautilus before giving up. */
-  app_info = g_desktop_app_info_new ("org.gnome.Nautilus.desktop");
-  list = g_list_append (list, (gpointer)uri);
-
-  if (app_info && g_app_info_launch_uris (G_APP_INFO (app_info), list, NULL, NULL))
-    g_signal_emit_by_name (webkit_uri_scheme_request_get_web_view (request), "close", NULL);
-  else
-    webkit_uri_scheme_request_finish_error (request, error);
-}
-
 static void
 initialize_web_process_extensions (WebKitWebContext *web_context,
                                    EphyEmbedShell   *shell)
@@ -1205,11 +1179,6 @@ ephy_embed_shell_startup (GApplication *application)
                                           (WebKitURISchemeRequestCallback)ephy_resource_request_cb,
                                           NULL, NULL);
 
-  /* No support for FTP, try to open in nautilus instead of failing */
-  webkit_web_context_register_uri_scheme (priv->web_context, "ftp",
-                                          (WebKitURISchemeRequestCallback)ftp_request_cb,
-                                          NULL, NULL);
-
   /* Store cookies in moz-compatible SQLite format */
   cookie_manager = webkit_web_context_get_cookie_manager (priv->web_context);
   if (!webkit_web_context_is_ephemeral (priv->web_context)) {
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 7e5874196..da4c408d4 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -124,7 +124,6 @@ ephy_embed_utils_address_has_web_scheme (const char *address)
 
   has_web_scheme = !(g_ascii_strncasecmp (address, "http", colonpos) &&
                      g_ascii_strncasecmp (address, "https", colonpos) &&
-                     g_ascii_strncasecmp (address, "ftp", colonpos) &&
                      g_ascii_strncasecmp (address, "file", colonpos) &&
                      g_ascii_strncasecmp (address, "javascript", colonpos) &&
                      g_ascii_strncasecmp (address, "data", colonpos) &&
diff --git a/tests/ephy-embed-utils-test.c b/tests/ephy-embed-utils-test.c
index b9c4c405f..19ceae352 100644
--- a/tests/ephy-embed-utils-test.c
+++ b/tests/ephy-embed-utils-test.c
@@ -49,7 +49,6 @@ static const SchemeTest tests_has_scheme[] = {
   { "http_with_port", "http://www.gnome.org:8080"; },
   { "https", "https://www.gnome.org/"; },
   { "http_caps", "HTTP://www.gnome.org/" },
-  { "ftp_with_user", "ftp://rupert:bananas ftp gnome org/epiphany/" },
   { "file", "file:///home/epiphany/code" },
   { "javascript", "javascript:var a=b;" },
   { "data", "data:\%20\%40" },


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