]> spindle.queued.net Git - midori/commitdiff
Allow opening data URIs from the location entry
authorChristian Dywan <christian@twotoasts.de>
Thu, 2 Apr 2009 20:48:07 +0000 (22:48 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 2 Apr 2009 20:48:07 +0000 (22:48 +0200)
midori/sokoke.c
tests/magic-uri.c

index dcdfd7898f695a6a36d9e881fa7f88ff0303f6ac..98b59ffeaf4e28040328f37372db0055bfdf1607 100644 (file)
@@ -221,7 +221,9 @@ sokoke_magic_uri (const gchar* uri,
         katze_array_is_a (search_engines, KATZE_TYPE_ITEM), NULL);
 
     /* 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);
     /* Add file:// if we have a local path */
     if (g_path_is_absolute (uri))
index f03a0a8cec7c7ea2b731932a295d0440d2766fde..4611959fc5dfb4c5e0446b7bcd9572c71b5d5c67 100644 (file)
@@ -137,6 +137,8 @@ magic_uri_pseudo (void)
 {
     test_input ("javascript:alert(1)", "javascript:alert(1)");
     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