tazweb view README @ rev 76

Lets have a custom user agent string!
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 24 00:43:36 2011 +0200 (2011-04-24)
parents 5bc3369a201f
children faa4ee68950b
line source
1 TazWeb - SliTaz Web Browser
2 ================================================================================
5 TazWeb is a radically simple and very light web browser providing a single
6 window with one small bottom toolbar using buttons, an URL and search entry,
7 and a contextual menu but no menubar or tabs. Please keep the code simple
8 and clean, if you are motivated and want to add some more functionality,
9 please talk to the AUTHOR before commiting anything in the repos.
11 TazWeb uses a custom page in the user Freedesktop directory to let users add
12 any content to it and get with one click from the toolbar. We may have
13 an external apps/script to handle that file for users who can't manage to
14 edit pure xHTML.
16 This application have been created for Tazpanel and future SliTaz integrated
17 Web applications. The goal is by far to have a fully-featured web browser. But
18 if you find a way to provide a simple plugins mechanism, that would be great.
20 The idea with TazWeb is to have a minimal interface, the approach is to
21 build all the GUI with xHTML and CSS like in TazPanel.
23 For general and end-user documentation have a look at doc/tazweb.html.
24 TazWeb is published, like webkit source under a free BSD license.
26 BUG: Right clicking on "Open Link in New Window" is connecting to an event
27 but doesn't work.
30 Build and install
31 -----------------
32 TazWeb depends on GTK and libwebkit. To build and test, simply:
34 $ make
35 $ ./tazweb
37 Install with 'make install' (PREFIX and DESTDIR are supported for packaging)
40 Coding notes
41 ------------
43 * To get the filename of a WebKitDownload
44 file = webkit_download_get_suggested_filename (download);
46 * Check mime-type before download (needs a callback function)
47 g_signal_connect (web_view, "mime-type-policy-decision-requested",
48 G_CALLBACK (mime_type_decision_cb), webview);
50 * Get user config directory path in $HOME
51 config = g_strdup_printf ("%s/.config/tazweb", g_get_home_dir ());
53 * This code changes the browser user-agent
54 static gchar *useragent = "TazWeb/1.0 (X11; Linux; U; en_US) AppleWebKit/531.2+";
56 /* User agent */
57 WebKitWebSettings *settings;
58 settings = webkit_web_view_get_settings (webview);
59 g_object_set (G_OBJECT (settings), "user-agent", useragent, NULL);
62 ================================================================================