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.
* 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);