20 December 2009

PyWebkitGTK Windows Binary

Python armed with webkitgtk? pywebkitgtk
See the demo:

This tabbed browser use 15KB of python code. Small eh?
But as you see we might need to impersonate the userAgent string into something like Safari (also using webkit) to shut facebook up... lol

Personally I didn't like its performance, it's nothing compared to safari (original implementator) not to mention Chrome! But talk about integration, WebkitGTK probably a bit ahead of QTWebkit by using Gstreamer (for multimedia backend) which I think still better than QT's phonon in Windows.

When both binded, HTML 5 will be a snap rather than what Opera 10 tries to do with their own way..

Update February 12, 2011
- Version 1.2.7: SVG=OK, Video/Audio=Very basic support, Unicode=Incomplete but major languages are fine,
Inspector=OK, JS=OK, CSS=OK, SVG Filters=Not works?, Flash/Plugins= Not supported, WML=Not supported, 
- Spellcheck=OK, Geolocation=Not tried (incompatible with LGPL?), ACID3 Test=98/100, Protocol: http:// file:/// no ftp

unicode test

Update January 27, 2011
- How To build WebkitGTK
- Version 1.2.6 in All-In-One Installer

Update November 13, 2010
- Force enchant to ignore prefix, use bundled enchant
- Disabling video: too buggy to enjoy
- No more zlib1.dll conflict, you can use from official one

Update August 12, 2010
- Update missing files: iconv and libhunspell, thanks to J. Seipp
- Adding locales
- Been trying webkit-1.2.3 with webM support but unable to get ffmpeg working

Update July 5, 2010
- Update to 1.2.1 which fix file's mime local open issue
- Bundling this package so it was compatible with official GTK 2.20
- I change icondatabase to be saved to %USERPROFILE%\Webkit instead of My Documents\Webkit
- Add missing icon in HTML5 player, Workaround to make inspector working
- Shrinking the dll size more.. now 6MB :)
- Glitches: 
   If you play HTML5 Video (currently support ogg) you shouldn't mute it, cause the sound wont come back
   Timeline slider, rewind and  forward button not working
   SVG was disabled, previously all of my builds also failed to render svg, strange.
- Installation:
   Download Official GTK 2.20 Bundle (link at bottom) and extract it to [somewhere]
   Move all files in bin folder to outside (1 level) root folder
   Extract webkit to [somewhere] and overwrite zlib1.dll (official version was too old)
   Add that [somewhere] to PATH environment

Update July 3, 2010
- Wondering why many test was failed... svg, video, inspector.. 
- Those who need proper runtime (dlls) build should go to midori site http://www.twotoasts.de/

Update April 26, 2010
- Updated to 1.2.0 download page moved here.  Actually the inspector is working, but somehow (in this case: midori) refuse to open inspector.html despite the mime is correct (text/x-html) strange huh!. Also fixed missing hunspell in previous version now spellcheck should working.

Update March 22, 2010
- Updated webkitgtk, now include spellchecker (english), development libs and headers, and localisation
- Uploaded Midori 0.2.4 windows binary, a nice c++ webkitgtk based browser. A bit crippled (during compilation) but mainly functional
- Inspector didn't work, spellcheck also

Update March 19, 2010
- I finally compiling webkitGTK 1.1.23 myself! I decide to cut off HTML-5 video feature (that's GStreamer bindings) to reduce the runtime size 10MB smaller than opensuse's cross-compile binary
- Still slooower than other webkit browser, probably because it using pango/glib instead of freetype/IBM's ICU?
- Now fakebook is working baby! Yeah I know the tab is buggy but nevermind, anyhow I guess it's not because useragent string eh :-/

Here is the binaries:

Report bugs, help the windows port!


  1. Hey, so just extract webkit gtk to your gtk install, right?

    1. This comment has been removed by the author.

  2. If you're using my WebkitGTK-1.1.23 (bundle) then you need to put your python (.py) files in "bin" folder of it (to make sure that all required dlls read during execution).

    Adding WebkitGTK-1.1.23's bin folder to Windows' PATH environment will works too.

  3. hi, could you please send me a copy of WebkitGTK- I cannot download it using the url you given.

    Pretty thanks and here is my mail address:
    juntao.qiu(#)gmail.com, just replace the "(#)" to @.

  4. This comment has been removed by the author.

  5. So, just place my program into the bin folder? or place the pywebkitgtk files in the bin folder?

  6. Your programs should in bin folder and you have 2 option for pywebkitgtk: place it in bin togather with your .py files or place it in site-packages folder of Python installation directory.

  7. Ok, makes sense! Thanks about infinity!

  8. I tested with python2.6 at my windows xp partition, with the hope it will works as in linux...It works perfect!, thank you man!
    Sorry about my english, I think even with my low level you understood my comment :)

  9. Excuse me you talk of your "WebkitGTK-1.1.23 (bundle)".. where I can find it?
    I'm trying to "install" webkit on my python but with other distribution I failed... I hope in you.

  10. http://dl.dropbox.com/u/2554170/dumped/WebkitGTK-1.1.23+GTK.7z

    Sorry it got flushed :P, BTW does newer version didn't work for you?

  11. TNK, I've found vs 1.1.16 and work... but now I'm trying to find a good reference, that I can understand because of I need to use special option for my project...
    Do you a tut, a guide, a manual, a simple exemple, something at least? (TNK)

  12. Great work. Still cannot import webkit module but I noticed the comment says SVG was disabled. Is it still unavailable? I need that feature...

  13. Akaishuichi, you should use M$ Dependency Walker to see which dll that failed.

    If you don't know about this, here is how:

    -Run depends.exe (from Windoze Support Tools)
    -Load python.exe
    -Start profiling (F7) in program arguments fill it with a full path to your main py file (if you have py2exe apps, load the main exe instead and leave argument blank).
    -Then from module pane you will see red box symbol for broken dll which related to error msg: "cannot found specified procedure"

  14. and for SVG support, I have an idea to do partial crosscompile in Ubuntu using cross Mingw against my win32 libs, that way SVG should works... but I'm too noob to barely operate Linux right now :D

  15. Thanks TumaGonx Zakkum. I found the missing dlls and it imports now.
    But without SVG support I have to give up pygtk. I know little about cross compiling and as all I want to do is to embed a page, it seems I would spend too much time on it.
    pygtk is my favorite ui library for python, it works great on Gnome but to get it work on windows is somehow painful experience...

  16. Go for PySide? it has built-in webkit module ;)

  17. Well I hope so, but svg support in QWebKit is experimental, it works fine for most case but does fail rendering my page. Actually I've tried all the webkit/gecko bindings for gtk/qt/wxpython. And none of them works in my case for various reasons. long story...

    I'm embedding chrome frame as an activex control in wxpython. It's not a good solution at all but currently seems to be the only way to go.

    If the svg issue would be fixed in qtwebkit-2.1, I might rewrite it in PySide. it looks very promising.:)

  18. Can you help me with this?

    I've put webkitgtk files inside my gtk folder and pywebkitgtk on my python2.6 folder but my program complains importing webkit.

    The file has only this line "import webkit" and this error appears:
    ImportError: DLL load failed: The specified module could not be found.

    If I move or rename the file webkit.pyd from C:\Python26\Lib\site-packages\webkit, the error dissapears, but the module is useless, it's empty, it only has the default methods of a python object.

    Any clue? bin folder is on the system's PATH variable and I've also tried running the program from webkit's bin folder.

  19. My comment should help you:

  20. I used your PyGTK AIO installer with python 2.7 and it's working now!

    Thanks for the great package!

    Now I have to fix the code because it's not working right so I can't really test webkit, I can import it at least and the methods are all there!

  21. Hi, I tried to play with pywebkitGTK and everything seems to work.
    The only problem I have is when I try to watch youtube videos. I have a white page instead of my video.
    It kinds of suck cause I want to do a small video player.
    Do you have any idea how to solve this problem ?


  22. See my last note, flash/plugins are not yet supported and what I meant with video/audio is the new html5 feature such theora/vorbis or webm streaming