diff -ur dillo-refresh/src/dillo.c dillo-refresh2/src/dillo.c --- dillo-refresh/src/dillo.c 2005-07-08 22:49:38.000000000 +0100 +++ dillo-refresh2/src/dillo.c 2005-07-12 22:14:18.000000000 +0100 @@ -71,6 +71,7 @@ DILLO_CLI_GEOMETRY = 1 << 6, DILLO_CLI_DBG_RENDERING = 1 << 7, DILLO_CLI_REFRESH = 1 << 8, //RAF-2004-10-27 + DILLO_CLI_REDIRECT = 1 << 9, DILLO_CLI_ERROR = 1 << 15 }; @@ -84,7 +85,7 @@ gboolean dillo_dbg_rendering = FALSE; /* RAF, 2004-10-27: adding command line option to allow refresh */ -gboolean dillo_refresh = FALSE; +gboolean dillo_refresh = FALSE, dillo_redirect = FALSE; /* * Forward declarations @@ -121,6 +122,8 @@ /* RAF 2004-10-27: command line option add */ {"-r", "-refresh", 0, DILLO_CLI_REFRESH, " -r, -refresh Allow meta refresh working as webmaster decided."}, + {"-rr", "-redirect", 0, DILLO_CLI_REDIRECT, + " -rr, -redirect Allow meta refresh to other URLs as webmaster decided."}, {NULL, NULL, 0, 0, NULL} }; @@ -256,6 +259,9 @@ case DILLO_CLI_DBG_RENDERING: dillo_dbg_rendering = TRUE; break; + case DILLO_CLI_REDIRECT: + dillo_redirect = TRUE; + /* redirect implies refresh, so fall through to next case */ /* RAF, 2004-10-27: adding command line option for meta refresh */ case DILLO_CLI_REFRESH: dillo_refresh = TRUE; diff -ur dillo-refresh/src/dillo.h dillo-refresh2/src/dillo.h --- dillo-refresh/src/dillo.h 2005-07-08 22:49:38.000000000 +0100 +++ dillo-refresh2/src/dillo.h 2005-07-12 21:56:33.000000000 +0100 @@ -7,6 +7,6 @@ extern gboolean dillo_dbg_rendering; /* RAF, 2004-10-27: adding command line option to allow refresh */ -extern gboolean dillo_refresh; +extern gboolean dillo_refresh, dillo_redirect; #endif /* __DILLO_H__ */ diff -ur dillo-refresh/src/html.c dillo-refresh2/src/html.c --- dillo-refresh/src/html.c 2005-07-08 22:49:38.000000000 +0100 +++ dillo-refresh2/src/html.c 2005-07-12 22:01:02.000000000 +0100 @@ -3225,10 +3225,11 @@ const gchar *meta_template = "\n" " \n" +" This page uses the NON-STANDARD meta refresh tag.%s\n" "
Warning:\n" -" This page uses the NON-STANDARD meta refresh tag.
The HTML 4.01 SPEC\n" -" (sec 7.4.4) recommends explicitly to avoid it.
The author wanted you to go\n" " here%s

\n"; + const gchar *redirect_warning = "
The HTML 4.01 SPEC\n" +" (sec 7.4.4) recommends explicitly to avoid it."; const gchar *equiv, *content; gchar *ptr, *html_msg, delay_str[64]; @@ -3270,7 +3271,7 @@ g_print("meta refresh: delay -> %d, url -> %s\n", delay, (*ptr) ? ptr : "none"); } - if(!dillo_refresh) { + if(!dillo_refresh || (!dillo_redirect && *ptr)) { /* Get delay, if present, and make a message with it */ if ((delay = strtol(content, NULL, 0))) g_snprintf(delay_str, 64, " after %d second%s.", @@ -3278,12 +3279,10 @@ else sprintf(delay_str, "."); - /* Skip to anything after "URL=" */ - while (*content && *(content++) != '='); - /* Send a custom HTML message * todo: this is a hairy hack, It'd be much better to build a widget. */ - html_msg = g_strdup_printf(meta_template, content, delay_str); + html_msg = g_strdup_printf(meta_template, *ptr?redirect_warning:"", + ptr, delay_str); { DilloHtmlProcessingState SaveFlags = html->InFlags; html->InFlags = IN_BODY;