Allow opening data URIs from the location entry

This commit is contained in:
Christian Dywan 2009-04-02 22:48:07 +02:00
parent 2d0e3b4c7e
commit 406942594a
2 changed files with 5 additions and 1 deletions

View file

@ -221,7 +221,9 @@ sokoke_magic_uri (const gchar* uri,
katze_array_is_a (search_engines, KATZE_TYPE_ITEM), NULL); katze_array_is_a (search_engines, KATZE_TYPE_ITEM), NULL);
/* Just return if it's a javascript: or mailto: uri */ /* Just return if it's a javascript: or mailto: uri */
if (g_str_has_prefix (uri, "javascript:") || g_str_has_prefix (uri, "mailto:")) if (g_str_has_prefix (uri, "javascript:")
|| g_str_has_prefix (uri, "mailto:")
|| g_str_has_prefix (uri, "data:"))
return g_strdup (uri); return g_strdup (uri);
/* Add file:// if we have a local path */ /* Add file:// if we have a local path */
if (g_path_is_absolute (uri)) if (g_path_is_absolute (uri))

View file

@ -137,6 +137,8 @@ magic_uri_pseudo (void)
{ {
test_input ("javascript:alert(1)", "javascript:alert(1)"); test_input ("javascript:alert(1)", "javascript:alert(1)");
test_input ("mailto:christian@twotoasts.de", "mailto:christian@twotoasts.de"); test_input ("mailto:christian@twotoasts.de", "mailto:christian@twotoasts.de");
test_input ("data:text/html;charset=utf-8,<title>Test</title>Test",
"data:text/html;charset=utf-8,<title>Test</title>Test");
} }
static void static void