aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-01-21 06:00:04 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-01-24 00:25:35 +0800
commit607017e7381f71968f64d7a464b2d94826db0dad (patch)
tree6d315acb06354c6ed5b3480a09e55c4c06b97c45
parent0e7ecc4b8f43ac53c3c1ab7a1281a4a959f86c5c (diff)
downloadgsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.tar
gsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.tar.gz
gsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.tar.bz2
gsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.tar.lz
gsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.tar.xz
gsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.tar.zst
gsoc2013-epiphany-607017e7381f71968f64d7a464b2d94826db0dad.zip
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
-rw-r--r--src/ephy-window.c17
1 files changed, 15 insertions, 2 deletions
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;
}