aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-09-11 22:50:11 +0800
committerXan Lopez <xlopez@igalia.com>2011-09-11 22:50:11 +0800
commita525b75a8ba54d1b296bde2a3d72748c3d6967a4 (patch)
tree8ee43a62daf2543ef88ce9338d10ebae01057ee1
parentee49121cf43796e1d55ac5589a97ed3dca286280 (diff)
downloadgsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.tar
gsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.tar.gz
gsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.tar.bz2
gsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.tar.lz
gsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.tar.xz
gsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.tar.zst
gsoc2013-epiphany-a525b75a8ba54d1b296bde2a3d72748c3d6967a4.zip
ephy-web-view: use SoupURI for about: check
Turns out the stuff after about: in a SoupURI will be the path, not the host. Guess it makes sense.
-rw-r--r--embed/ephy-web-view.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 7da57a930..d181c9b67 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1887,7 +1887,9 @@ load_status_cb (WebKitWebView *web_view,
ephy_web_view_set_security_level (EPHY_WEB_VIEW (web_view), security_level);
}
break;
- case WEBKIT_LOAD_FINISHED:
+ case WEBKIT_LOAD_FINISHED: {
+ SoupURI *uri;
+
g_free (priv->status_message);
priv->status_message = NULL;
g_object_notify (object, "status-message");
@@ -1905,9 +1907,9 @@ load_status_cb (WebKitWebView *web_view,
/* FIXME: It sucks to do this here, but it's not really possible
* to hook the DOM actions nicely in the about: generator. */
- /* FIXME: it would be safer to validate this with SoupURI but
- * 'host' is NULL for ephy-about:applications ... */
- if (g_str_has_prefix (webkit_web_view_get_uri (web_view), "ephy-about:applications")) {
+ uri = soup_uri_new (webkit_web_view_get_uri (web_view));
+ if (!g_strcmp0 (uri->scheme, "ephy-about") &&
+ !g_strcmp0 (uri->path, "applications")) {
WebKitDOMDocument *document;
WebKitDOMNodeList *buttons;
gulong buttons_n;
@@ -1925,9 +1927,12 @@ load_status_cb (WebKitWebView *web_view,
G_CALLBACK (delete_web_app_cb), false,
NULL);
}
+
+ soup_uri_free (uri);
}
break;
+ }
case WEBKIT_LOAD_FAILED:
ephy_web_view_set_link_message (view, NULL);
ephy_web_view_set_loading_title (view, NULL, FALSE);