From 44f1f35436c85ba3d8adf1ba3202db116bb4b914 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 20 Mar 2005 03:35:50 +0000 Subject: [project @ 2005-03-20 03:35:50 by jmb] Improve handling of fragments on the same page as already loaded. svn path=/import/netsurf/; revision=1550 --- desktop/browser.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 259358acd..47176c8a7 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -192,11 +192,20 @@ void browser_window_go_post(struct browser_window *bw, const char *url, } if (hash) { bw->frag_id = strdup(hash+1); + /* if we're simply moving to another ID on the same page, + * don't bother to fetch, just update the window + */ + if (strncasecmp(bw->current_content->url, + url2, hash - url2) == 0) { + free(url2); + browser_window_update(bw, false); + return; + } } - url_content = url_store_find(url2); - if (url_content) - url_content->visits++; + url_content = url_store_find(url2); + if (url_content) + url_content->visits++; browser_window_set_status(bw, messages_get("Loading")); bw->history_add = history_add; -- cgit v1.2.3