Update: the trivial WebKit browser is now included in Ubuntu. Simply install libwebkitgdk0d on Ubuntu gutsy (just click the package name there to install it if you’re running gutsy now) and then run /usr/lib/WebKit/GdkLauncher to get a simple WebKit browser for testing your code.
You too can test WebKit, Apple’s web rendering engine and the thing that makes Safari work, on Linux. The KDE teams have been working hard on making it work inside Qt, the KDE widget set, and indeed it does work! A few simple steps are required.
First, check out the WebKit source code. There is loads of it, so this will take a while. You’ll need Subversion for this.
svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit
That will give you a folder called WebKit. You’ll now need a few requirements; the key one is Qt4. On Ubuntu 6.10 (edgy), get this like so:
sudo aptitude install libqt4-dev
Now build your Qt-based WebKit browser:
QTDIR=/usr/share/qt4/ WebKit/WebKitTools/Scripts/build-webkit
Finally, run it:
WebKit/WebKitBuild/Release/WebKitQt/QtLauncher/QtLauncher about:blank
I created a menu entry to run it (right-click on the Applications menu, say “Edit Menus”). Now I can test stuff in WebKit!
Note that the Subversion version of WebKit is miiiiiiiiles ahead of what Safari is using in released versions of Mac OS X, so don’t think that just because something works in your little WebKit browser it’ll work in Safari. Nonetheless, cool.
Is the javascript handling code included in the WebKit? Or, Can I test my JavaScript apps using this?
Posted by Binny V A on April 8th, 2007.
Binny V A: yep. I used it to test the recent sorttable release.
Posted by sil on April 8th, 2007.
The javascript engine in WebKit is afaik not the same that’s in safari, at least not when you build against Qt for some reason. Or so a trolltech guy told me, at least… :/
Posted by Anonymous on April 10th, 2007.
[...] Concretamente, Kryogenix da instrucciones de como instalarlo (por medio de virtualización me temo) en Ubuntu 6.10. [...]
Posted by Probar un navegador WebKit en Linux | La brujula verde on April 10th, 2007.
Navegador Webkit en Linux…
Parece que ya es posible correr un navegador Webkit en Linux. Instrucciones para Ubuntu 6.10. Vía: http://www.labrujulaverde.com/2007/04/10/probar-un-navegador-webkit-en-linux/...
Posted by meneame.net on April 10th, 2007.
Thanks for posting your findings! svn checkout went fine, but I’ve run into an error after running
QTDIR=/usr/share/qt4/ WebKit/WebKitTools/Scripts/build-webkit
I’ll get an error:
———————————
***Unknown option -r
Usage: qmake [mode] [options] [files]
Failed to setup build environment using qmake!
———————————
Do you have any suggestions? Thanks in advance!
Posted by Jon on April 17th, 2007.
Jon: I had that problem. I suspect that you have the qmake from Qt 3, and you need the one from Qt 4.
Posted by sil on April 17th, 2007.
That was it, thank you very much. As I went to build the browser, however, I ran into another problem. Maybe you can help?
–
../../../WebCore/html/HTMLDocument.cpp: In member function ‘virtual void WebCore::HTMLDocument::determineParseMode(const WebCore::String&)’:
../../../WebCore/html/HTMLDocument.cpp:389: error: expected initializer before ‘*’ token
../../../WebCore/html/HTMLDocument.cpp:390: error: ‘doctypeEntry’ was not declared in this scope
../../../WebCore/html/HTMLDocument.cpp:398: error: ‘doctypeEntry’ was not declared in this scope
../../../WebCore/html/HTMLDocument.cpp:401: error: ‘PubIDInfo’ has not been declared
../../../WebCore/html/HTMLDocument.cpp:405: error: ‘PubIDInfo’ has not been declared
../../../WebCore/html/HTMLDocument.cpp:409: error: ‘PubIDInfo’ has not been declared
make[1]: *** [tmp/HTMLDocument.o] Error 1
make[1]: Leaving directory `/home/jon/WebKit/WebKitBuild/Release/WebCore’
make: *** [sub-WebCore-make_default-ordered] Error 2
–
I’m really not sure what step to take next.
Posted by Jon on April 18th, 2007.
Jon: don’t know about that, I’m afraid. I’d suggest asking on IRC, on #webkit on irc.freenode.net.
Posted by sil on April 18th, 2007.
Okay thanks a lot anyways — I’ll check into it.
Posted by Jon on April 18th, 2007.
[...] Via: link [...]
Posted by nulleando.com.ar » El engine de safari en linux on May 2nd, 2007.
I am getting the same XX has not been declared error. What commit id were things at when you built it successfully? I’ll be happy to rewind my SVN checkout to that revision number to get things to build.
(In other words, the tree seems to be broken currently :-( — is the webkit team using something like tinderbox to check their builds? )
Posted by martin langhoff on May 28th, 2007.
Posted by sil on May 28th, 2007.
i found i had to add the gperf table into HTMLDocument.cpp
gperf -CEot -L ANSI-C -k “*” -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards > WebCore/html/HTMLDocument.cpp
end then edit the file by hand to move the gperf-generated table to a point prior to the first reference to it.
i also applied this patch to fix a problem with the wrong qmake being called:
Index: WebKitTools/Scripts/webkitdirs.pm
===================================================================
— WebKitTools/Scripts/webkitdirs.pm (revision 23560)
+++ WebKitTools/Scripts/webkitdirs.pm (working copy)
@@ -487,7 +487,8 @@
system “mkdir -p ” . baseProductDir() . “/$config”;
chdir baseProductDir() . “/$config” or die “Failed to cd into ” . baseProductDir() . “/$config \n”;
- my $result = system “qmake”, @buildArgs;
+ my $result = system “qmake-qt4″, @buildArgs;
+ $result = system “qmake”, @buildArgs if ($result ne 0);
if($result ne 0) {
die “Failed to setup build environment using qmake!\n”;
}
Posted by bsittler on June 18th, 2007.
When I tried to do this I got: ERROR: flex, bison, gperf missing but required to build WebKit.
So I searched and installed the required libraries and then executed again the build line:
sudo apt-get install flex gperf bison
Posted by movil on October 23rd, 2007.
[...] Los pasos para crearlo (via kryogenix y no traduzco esta parte a menos que alguien lo pida expresamente) [...]
Posted by » Safari y otros navegadores en Linux on October 23rd, 2007.
If you have the problem of qmake v3 called instead of qmake v4 (***Unknown option -r), you can add this option to the command line:
–qmake=qmake-qt4
for example:
QTDIR=/usr/share/qt4/ WebKit/WebKitTools/Scripts/build-webkit –qmake=qmake-qt4
Posted by frasten on November 27th, 2007.
[...] Font: WebKit browser on Linux [...]
Posted by Message in a bottle…. » Navegador Webkit en linux on January 16th, 2008.
I recently started a project called Arora which is a browser using QtWebKit. It provides a lot more then the QtLauncher does and can build against WebKit trunk or the already released Qt 4.4 packages. It is already good enough for most of my daily browsing and even writing this comment.
Posted by Benjamin Meyer on June 3rd, 2008.
Hmm, looks like the link didn’t work. http://arora-browser.org/
Posted by Benjamin Meyer on June 3rd, 2008.
Hey, thanks for this post! I’ve followed it and it worked perfectly in my Gentoo/Linux.
Posted by Denilson on August 7th, 2008.
Or just search for and install Midori with Synaptic Package Manager.
* Full integration with GTK+2.
* Fast rendering with WebKit.
* Tabs, windows and session management.
* Bookmarks are stored with XBEL.
* Searchbox based on OpenSearch.
* User scripts and user styles support.
Posted by Leon on February 1st, 2009.
Leon: absolutely Midori is the way to go now. It wasn’t available two years ago when I wrote this :-)
Posted by sil on February 1st, 2009.