Bug#551268: kazehakase-webkit: http:// is required when typing in urls

2009-10-18 Thread Yavor Doganov
Andres Salomon wrote:
 1) presumably you want to look for gopher: rather than just gopher?

Yes, that was a typo, thanks.

 2) Are spaces before the url stripped?  g_str_is_prefix(s, http:)
 won't match if 's' is   http://foo;, for example.

Right :/  The only (ugly) solution I can think of right now is

  g_str_has_prefix(g_strchug((gchar *)uri), http:)

and subsequently

  effective_uri = g_strconcat(http://;, g_strstrip((gchar *)uri), NULL);

(The cast to gchar* is to avoid warnings.)

 I'm not sure what you mean regarding the search module; typing
 random strings into the url does a proper google search for me w/
 kazehakase-webkit.

I mean the history search module (hyper-estraier.so) which is quite a
different thing.  If you go to Preference-History and activate it,
indexing is performed for all pages you visit, stored in a private
database in ~/.kazehakase.  Then if you type a search string in the
History Search box, a nice page is being generated with the results.
This is entirely an offline activity, and you can use HyperEstraier
regular expressions to narrow the search.

It may sound unwieldy and resource-consuming, but actually both the
incremental indexing and searching is quite fast, and this
functionaility is very useful.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#551268: kazehakase-webkit: http:// is required when typing in urls

2009-10-17 Thread Yavor Doganov
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.0 +0300
+++ kazehakase-0.5.8/module/embed/webkit-gtk/kz-webkit-gtk.c2009-10-17 
13:38:05.0 +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


Bug#551268: kazehakase-webkit: http:// is required when typing in urls

2009-10-17 Thread Andres Salomon
On Sat, 17 Oct 2009 14:02:42 +0300
Yavor Doganov ya...@gnu.org wrote:

 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.


Awesome, thanks!  Two comments about the patch:

1) presumably you want to look for gopher: rather than just gopher?

2) Are spaces before the url stripped?  g_str_is_prefix(s, http:)
won't match if 's' is   http://foo;, for example.

I'm not sure what you mean regarding the search module; typing random
strings into the url does a proper google search for me w/
kazehakase-webkit.




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#551268: kazehakase-webkit: http:// is required when typing in urls

2009-10-16 Thread Andres Salomon
Package: kazehakase-webkit
Version: 0.5.8-1

The webkit plugin for kazehakase does not accept typing in urls without
the preceding http://;.  For example, if I type in just lwn.net, I
get:

Unable to load page

Problem occurred while loading the URL lwn.net

URL cannot be shown

However, if I type in http://lwn.net;, the page is loaded just fine.
It would enhance the usability of the browser greatly (for me at
least) if it assumed that typed-in urls should get an http://; prefix
unless there's already a :// in the string.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#551268: kazehakase-webkit: http:// is required when typing in urls

2009-10-16 Thread Yavor Doganov
tags 551268 confirmed
thanks

Andres Salomon wrote:
 The webkit plugin for kazehakase does not accept typing in urls
 without the preceding http://;.

Yes, I noticed that when testing the new release, and I agree this is
a major nuisance for users (although IMHO not deserving RC severity).

The Epiphany bug #548567 has something related:

| * URLs such as 'localhost:8000' and 'localhost/manual' result in a
|   Google search. Webkit does not like leaving off the initial
|   'http://' from an entered URL. Major functionality regression with
|   privacy implications.  Unfortunately, upstream can't reproduce it,
|   maybe it's because of a Debian specific patch?
|   https://bugzilla.gnome.org/show_bug.cgi?id=595690

But there's a genuine kazehakase bug here, because of the way Kz
treats URIs (whether a smartbookmark, history-search:, etc.).  I'll
try to find the real cause and fix it, or failing that, at least
report it upstream.

Thanks.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#551268: kazehakase-webkit: http:// is required when typing in urls

2009-10-16 Thread Andres Salomon
On Fri, 16 Oct 2009 22:56:54 +0300
Yavor Doganov ya...@gnu.org wrote:

 tags 551268 confirmed
 thanks
 
 Andres Salomon wrote:
  The webkit plugin for kazehakase does not accept typing in urls
  without the preceding http://;.
 
 Yes, I noticed that when testing the new release, and I agree this is
 a major nuisance for users (although IMHO not deserving RC severity).

Agreed, which is why the severity's normal.

[...]
 
 But there's a genuine kazehakase bug here, because of the way Kz
 treats URIs (whether a smartbookmark, history-search:, etc.).  I'll
 try to find the real cause and fix it, or failing that, at least
 report it upstream.
 

Thanks!  Feel free to email me for sponsorship, too (though I may
require a few days to get !busy).



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org