From 607017e7381f71968f64d7a464b2d94826db0dad Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Wed, 20 Jan 2010 17:00:04 -0500 Subject: ephy-window: pass non-web schemas to gtk_show_uri Handle every non-web scheme in policy_decision_required_cb with gtk_show_uri. This enables xmpp:, apt: and similar links to work. https://bugzilla.gnome.org/show_bug.cgi?id=551857 --- src/ephy-window.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 5a6dbd2ad..1b5737a66 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2290,9 +2290,22 @@ policy_decision_required_cb (WebKitWebView *web_view, state = webkit_web_navigation_action_get_modifier_state (action); uri = webkit_network_request_get_uri (request); - if (g_str_has_prefix (uri, "mailto:")) { + if (!ephy_embed_utils_address_has_web_scheme (uri)) + { + GError *error = NULL; + GdkScreen *screen; + webkit_web_policy_decision_ignore (decision); - gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL); + + screen = gtk_widget_get_screen (GTK_WIDGET (web_view)); + gtk_show_uri (screen, uri, GDK_CURRENT_TIME, &error); + + if (error) + { + LOG ("failed to handle non web scheme: %s", error->message); + g_error_free (error); + } + return TRUE; } -- cgit v1.2.3