WebKit browser on Linux
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?
5 hours later
Binny V A: yep. I used it to test the recent sorttable release.
5 hours later
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… :/
43 hours later
[...] Concretamente, Kryogenix da instrucciones de como instalarlo (por medio de virtualización me temo) en Ubuntu 6.10. [...]
2 days later
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/...
2 days later
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!
9 days later
Jon: I had that problem. I suspect that you have the qmake from Qt 3, and you need the one from Qt 4.
9 days later
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.
10 days later
Jon: don’t know about that, I’m afraid. I’d suggest asking on IRC, on #webkit on irc.freenode.net.
10 days later
Okay thanks a lot anyways — I’ll check into it.
10 days later
[...] Via: link [...]
3 weeks later
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? )
7 weeks later
7 weeks later
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”;
}
10 weeks later
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
28 weeks later
[...] Los pasos para crearlo (via kryogenix y no traduzco esta parte a menos que alguien lo pida expresamente) [...]
28 weeks later
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
33 weeks later
[...] Font: WebKit browser on Linux [...]
40 weeks later
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.
60 weeks later
Hmm, looks like the link didn’t work. http://arora-browser.org/
60 weeks later
Hey, thanks for this post! I’ve followed it and it worked perfectly in my Gentoo/Linux.
69 weeks later