diff options
author | Xan Lopez <xan@gnome.org> | 2009-08-10 18:55:51 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-08-10 18:55:51 +0800 |
commit | af12311055ac2d9ea29103fbb507a3a1f6798658 (patch) | |
tree | eae5f478974e868012f4d8b93baa263bbb84462e /embed | |
parent | 44706a1d0bc863eb6ffd9e14a207c230e9d3a028 (diff) | |
download | gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.tar gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.tar.gz gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.tar.bz2 gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.tar.lz gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.tar.xz gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.tar.zst gsoc2013-epiphany-af12311055ac2d9ea29103fbb507a3a1f6798658.zip |
Move address normalization to the EphyWebView functions.
EphyLink is called repeatedly when opening URLs, so normalizing the
address there all the time is pointless. Also, we don't go through
here in all cases, so we need to add the normalization in the
ephy_web_view_load_request function too; this fixes opening URLs like
"foo.com" from the command line, for example.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/ephy-web-view.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index db11f1f07..9da36edda 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1043,11 +1043,18 @@ ephy_web_view_load_request (EphyWebView *web_view, WebKitNetworkRequest *request) { WebKitWebFrame *main_frame; + const char *url; + char *effective_url; - g_return_if_fail(EPHY_IS_WEB_VIEW(web_view)); - g_return_if_fail(WEBKIT_IS_NETWORK_REQUEST(request)); + g_return_if_fail(EPHY_IS_WEB_VIEW(web_view)); + g_return_if_fail(WEBKIT_IS_NETWORK_REQUEST(request)); - main_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(web_view)); + url = webkit_network_request_get_uri (request); + effective_url = ephy_embed_utils_normalize_address (url); + webkit_network_request_set_uri (request, effective_url); + g_free (effective_url); + + main_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(web_view)); webkit_web_frame_load_request(main_frame, request); } @@ -1062,10 +1069,14 @@ void ephy_web_view_load_url (EphyWebView *view, const char *url) { + char *effective_url; + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); g_return_if_fail (url); - webkit_web_view_open (WEBKIT_WEB_VIEW (view), url); + effective_url = ephy_embed_utils_normalize_address (url); + webkit_web_view_open (WEBKIT_WEB_VIEW (view), effective_url); + g_free (effective_url); } /** |