tags 551268 + pending
thanks

The attached patch works for me (I took a similar approach like
Epiphany).  However, the search module is still useless with WebKit;
I'll look deeper into it.

Andres Salomon wrote:
> Feel free to email me for sponsorship, too

Thanks, but at this point I'd prefer not to disrupt the ongoing
xulrunner transition, so it seems better to upload after the package
migrates to testing.

#! /bin/sh /usr/share/dpatch/dpatch-run
## 55_webkit-uri.dpatch by Yavor Doganov <ya...@gnu.org>
##
## DP: Prepend http:// to URLs by default.  Do not use the deprecated
## DP: function `webkit_web_view_open'.
## DP: Reported by Andres Salomon at #551268.

@DPATCH@
diff -urNad kazehakase-0.5.8~/module/embed/webkit-gtk/kz-webkit-gtk.c 
kazehakase-0.5.8/module/embed/webkit-gtk/kz-webkit-gtk.c
--- kazehakase-0.5.8~/module/embed/webkit-gtk/kz-webkit-gtk.c   2009-10-17 
13:36:40.000000000 +0300
+++ kazehakase-0.5.8/module/embed/webkit-gtk/kz-webkit-gtk.c    2009-10-17 
13:38:05.000000000 +0300
@@ -383,7 +383,26 @@
 static void
 load_uri (KzEmbed *kzembed, const gchar  *uri)
 {
-    webkit_web_view_open(KZ_WEBKIT_GTK_GET_PRIVATE(kzembed)->web_view, uri);
+    gchar *effective_uri;
+
+    if (!uri)
+        effective_uri = g_strdup("about:blank");
+    else if (!(g_str_has_prefix(uri, "http:")
+               || g_str_has_prefix(uri, "https:")
+               || g_str_has_prefix(uri, "ftp:")
+               || g_str_has_prefix(uri, "file:")
+               || g_str_has_prefix(uri, "data:")
+               || g_str_has_prefix(uri, "about:")
+               || g_str_has_prefix(uri, "history-search:")
+               || g_str_has_prefix(uri, "gopher")))
+        effective_uri = g_strconcat("http://";, uri, NULL);
+    else
+        effective_uri = g_strdup(uri);
+
+    webkit_web_view_load_uri(KZ_WEBKIT_GTK_GET_PRIVATE(kzembed)->web_view,
+                             effective_uri);
+
+    g_free(effective_uri);
 }
 
 static void

Reply via email to