From 4b6977feeac0358c92e046ddba9d2c504523ad82 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Thu, 16 Jul 2015 23:13:50 +0200 Subject: [PATCH] Fixed unset of current url on stop loading (#224). If and url is loaded and the real url is already available in the webview the provisional data sour seems to be not available anymore. This caused '(null)' be shown in url bar in case a page loading was aborted by CTRL-C. To fix this the provisional data source is used to get the current url as long as it exists, else the webview's url is taken. --- src/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index f229e10..662b125 100644 --- a/src/main.c +++ b/src/main.c @@ -789,8 +789,12 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec) * use the provisional uri here. */ WebKitWebFrame *frame = webkit_web_view_get_main_frame(view); WebKitWebDataSource *src = webkit_web_frame_get_provisional_data_source(frame); - WebKitNetworkRequest *req = webkit_web_data_source_get_initial_request(src); - uri = webkit_network_request_get_uri(req); + if (src) { + WebKitNetworkRequest *req = webkit_web_data_source_get_initial_request(src); + uri = webkit_network_request_get_uri(req); + } else { + uri = webkit_web_view_get_uri(view); + } vb_update_urlbar(uri); #ifdef FEATURE_AUTOCMD autocmd_run(AU_LOAD_FAILED, uri, NULL); -- 2.20.1