Friday, May 16, 2008

WebKit-Sharp and my FunnyBrowser

In my last article I blogged about how to create Mono bindings using GAPI, I used it to create WebKit-Sharp.

After a quick search in Google I found another implementation of WebKit bindings for Mono, you can find them there (http://cmartin.tk/webkitgtk-sharp.html), the problem is that those bindings were done by hand without using GAPI, probably because the author didn't use "gapi2-fixup" to customize and fix some information about webkit (You can find more information about it here).

Well, today I have just committed some of my local changes to webkit-sharp and the amazing "FunnyBrowser" sample, I have been using "FunnyBrowser" as my default browser now for one week and for basic navigation it works faster and uses less resources than Firefox.

Next weekend I am also planning to make packages available for Maemo if webkit works on it, I will keep you guys posted.



We haven't released webkit-sharp yet but you can found sources here:

http://anonsvn.mono-project.com/viewcvs/trunk/webkit-sharp.tar.gz

OpenSUSE 10.3 packages are also available (including libwebkit) on my repository in the OpenSUSE Build Service:

http://download.opensuse.org/repositories/home:/ecanuto:/webkit/openSUSE_10.3/

I have plans to release FunnyBrowser as package when it works with GMail without problems.

19 comments:

Paul Burton said...

Would it be possible to add the navigation-requested signal to WebView? I ask because I added support for webkit to Galaxium messenger using the nwebkit binding with a couple of signals added manually, and navigation-requested is the only thing that stops me from switching it over to your binding (obviously an IM app needs to stop links being followed).

It'd be nice if everyone could standardize on a single binding and yours seems to be the most complete.

Everaldo Canuto said...

Hey, I cant find navigation-requested signal in WebKit sources. How do you implemented it?

Btw, I am talking with Alp about possibility to merge our efforts, basically we must merge our metadatas.

Paul Burton said...

Its defined in WebKit/gtk/webkit/webkitwebview.cpp line 744. I added the following to the api xml to use it:

http://monoport.com/11832

The return type is actually the WebKitNavigationResponse enum, but the gapi codegen didn't seem to like that so I made it int and typecasted enum values. I'm sure theres probably a better solution, but I don't know a whole lot about the gapi utilities.

Everaldo Canuto said...

Thanks, it is right solution, I just put it in the .metadata file.

It is now committed to SVN r103372.

Bundyo said...

There's Webkit in Maemo Extras. Its from March though.

Everaldo Canuto said...

Do you know how I can make packages available in Maemo extras and maybe update webkit?

knocte said...

Would it be easy for that browser to make it backend-configurable? I mean, being able to change between Gecko and WebKit on the fly.

If yes, I would be interested in contributing to an effort like this, trying to evolve the next epiphany or firefox-lite!

Alexandre Gomes said...

Hello Everaldo, Does it work on Windows? If not, any ETA for it?

Bundyo said...

This should get you started.

http://www.internettablettalk.com/forums/showthread.php?t=19033

Carlos Martín Nieto said...

The reason I started writing the bindings manually was because GAPI couldn't parse the headers properly.
I'll see if I can extend the bindings futher using proper methods :)

Everaldo Canuto said...

Hey Alexandre, I don't know if it works on Win32, probably we must test if gtk version of WebKit compiles on Win32.

I will make some tests next weekend.

Paul Burton said...

Thanks for adding navigation-requested. I made some deb packages for Ubuntu which can be found at https://launchpad.net/~paulburton89/+archive.

One problem I found is that whilst webkit-sharp is installed into the GAC and both gacutil and pkg-config see it, MonoDevelop doesn't show it in the references dialog. I guess this is a problem with the .pc file?

Everaldo Canuto said...

Hey Paul, .pc problem is now fixed in SVN r103605.

For right .pc contents please take a looks at: http://monoport.com/12239

Ah, theres Galaxium Messenger packages available for OpenSUSE 10.3 or 11 ?

Thanks.

Paul Burton said...

Thanks for the fix :) I'll update the deb tonight, then switch galaxium over to webkit-sharp.

Ben Motmans was going to build galaxium packages with the OpenSUSE build service, but I don't think he's done it yet.

Everaldo Canuto said...

Could you give me some screenshots of Galaxium Messenger using WebKit, I would like to blog about this ;)

(everaldo.canuto@gmail.com)

David Paleino said...

Hi Everaldo,
I've packaged webkit-sharp for Debian, hopefully it will enter soon experimental (I don't feel like putting it to unstable -- I've packaged a SVN snapshot and, well, that's no guarantee at all ;) )

You can find the Debian source package (.dsc) at:

http://mentors.debian.net/debian/pool/main/w/webkit-sharp/

Keep up the good work with Mono! :)

Everaldo Canuto said...

You could try to use the oficial 0.2 release:

http://mono.ximian.com/monobuild/preview/sources/webkit-sharp/webkit-sharp-0.2.tar.bz2

Толік said...

Is it working on windows? I trying compile version 0.3.3 from git. On windows codegeneration fail. I created files on linux, copied them to Win and build the project. But FunnyBrowser crash on start (seems it can not access some functions in dll, figuring out with it)

coco said...

Hi everaldo, I've a little doubt, is possible comunicate js to .Net code similar to XulRunner w GeckoFX , I've used XulRunner and this work really good but I wish give a try to webkit, now...I can't find almost any documentation and his hard know how do the things...is possible communicate both languages and you can give me some link or example...thanks so much scampy, have a good day...