[project @ 2004-11-22 23:29:50 by jmb]

Move URI handleability check to last minute prior to starting fetch - this enables catching of redirects to unsupported URIs.

svn path=/import/netsurf/; revision=1371
This commit is contained in:
John Mark Bell 2004-11-22 23:29:50 +00:00
parent 9c6094944b
commit 91b23308e1
1 changed files with 15 additions and 13 deletions

View File

@ -173,6 +173,16 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
return;
}
browser_window_stop(bw);
browser_window_remove_caret(bw);
/* check we can actually handle this URL */
if (!fetch_can_fetch(url2)) {
gui_launch_url(url2);
free(url2);
return;
}
hash = strchr(url2, '#');
if (bw->frag_id) {
free(bw->frag_id);
@ -182,9 +192,6 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
bw->frag_id = strdup(hash+1);
}
browser_window_stop(bw);
browser_window_remove_caret(bw);
browser_window_set_status(bw, messages_get("Loading"));
bw->history_add = history_add;
bw->time0 = clock();
@ -798,16 +805,11 @@ void browser_window_mouse_click_html(struct browser_window *bw,
pointer = GUI_POINTER_POINT;
if (click == BROWSER_MOUSE_CLICK_1 ||
click == BROWSER_MOUSE_CLICK_2) {
if (fetch_can_fetch(url)) {
if (click == BROWSER_MOUSE_CLICK_1)
browser_window_go(bw, url, c->url);
else
browser_window_create(url, bw, c->url);
} else {
gui_launch_url(url);
}
if (click == BROWSER_MOUSE_CLICK_1) {
browser_window_go(bw, url, c->url);
}
else if (click == BROWSER_MOUSE_CLICK_2) {
browser_window_create(url, bw, c->url);
}
} else if (title) {