From 9454b8bca10f2ac8e224b9d60d71355b36194555 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 2 Apr 2004 00:41:10 +0000 Subject: [project @ 2004-04-02 00:41:10 by jmb] Try to use external apps for URI schemes we don't understand (eg mailto:) svn path=/import/netsurf/; revision=698 --- desktop/browser.c | 14 ++++++++++++-- desktop/gui.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 8735a7ca2..149f5a2e2 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -162,16 +162,26 @@ void browser_window_go_post(struct browser_window *bw, const char *url, browser_window_set_status(bw, messages_get("Loading")); bw->history_add = history_add; bw->time0 = clock(); - if (strncmp(url2, "about:", 6) == 0) + if (strncmp(url2, "about:", 6) == 0) { c = about_create(url2, browser_window_callback, bw, 0, gui_window_get_width(bw->window), 0); - else + } + /* check that we can handle the URL - just http/https/file for now */ + else if (strncmp(url2, "http:", 5) != 0 && strncmp(url2, "https:", 6) != 0 && + strncmp(url2, "file:", 5) != 0) { + gui_launch_url(url2); + browser_window_set_status(bw, messages_get("LaunchURL")); + free(url2); + return; + } + else { c = fetchcache(url2, 0, browser_window_callback, bw, 0, gui_window_get_width(bw->window), 0, false, post_urlenc, post_multipart, true); + } free(url2); if (!c) { browser_window_set_status(bw, messages_get("FetchFailed")); diff --git a/desktop/gui.h b/desktop/gui.h index 684332c56..9bb8412e4 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -55,6 +55,8 @@ void gui_gadget_combo(struct browser_window* bw, struct form_control* g, unsigne void gui_window_place_caret(gui_window *g, int x, int y, int height); +void gui_launch_url(char *url); + void warn_user(const char *warning); #endif -- cgit v1.2.3