aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2010-04-23 18:13:53 +0800
committerFrédéric Péters <fpeters@0d.be>2010-06-08 00:31:25 +0800
commitd8497bf4863991e470b35446347e55756d923cf7 (patch)
tree0a3eadb1ae8a48f03ce729d52da562da1e8996f2 /embed
parentc37f7cfa5b395a28d0659da375c1433df49280a9 (diff)
downloadgsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.tar
gsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.tar.gz
gsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.tar.bz2
gsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.tar.lz
gsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.tar.xz
gsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.tar.zst
gsoc2013-epiphany-d8497bf4863991e470b35446347e55756d923cf7.zip
Fixed detected feed URL for relative URIs
Bug #609817
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-web-view.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 70444bc17..f5d155863 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1264,8 +1264,21 @@ do_hook_into_links (JSContextRef js_context, EphyWebView *web_view)
char *type = js_get_element_attribute (js_context, obj, "type");
char *title = js_get_element_attribute (js_context, obj, "title");
char *address = js_get_element_attribute (js_context, obj, "href");
+ SoupURI *feed_uri, *current_uri;
- g_signal_emit_by_name (web_view, "ge-feed-link", type, title, address);
+ feed_uri = soup_uri_new (address);
+ if (!feed_uri) {
+ current_uri = soup_uri_new (ephy_web_view_get_address (web_view));
+ feed_uri = soup_uri_new_with_base (current_uri, address);
+ soup_uri_free (current_uri);
+ }
+
+ if (feed_uri) {
+ g_free (address);
+ address = soup_uri_to_string (feed_uri, FALSE);
+ g_signal_emit_by_name (web_view, "ge-feed-link", type, title, address);
+ soup_uri_free (feed_uri);
+ }
g_free (type);
g_free (title);