tazweb diff src/tazweb.c @ rev 189
Better private browsing (no cache or global history), up french translation
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Mar 15 00:47:49 2017 +0100 (2017-03-15) |
parents | f71f2a7adfbf |
children | 6a5a94a11ff7 |
line diff
1.1 --- a/src/tazweb.c Tue Mar 14 13:16:04 2017 +0100 1.2 +++ b/src/tazweb.c Wed Mar 15 00:47:49 2017 +0100 1.3 @@ -30,7 +30,6 @@ 1.4 int width = 800; 1.5 int height = 600; 1.6 int private = 0; 1.7 -int debug = 1; 1.8 1.9 static gchar *useragent = "TazWeb (X11; SliTaz GNU/Linux; U; en_US)"; 1.10 static gboolean notoolbar; 1.11 @@ -392,6 +391,12 @@ 1.12 gtk_widget_show_all(GTK_WIDGET(menu)); 1.13 } 1.14 1.15 +void 1.16 +webkit_settings_set_user_agent_with_application_details 1.17 + (WebKitWebSettings *settings, 1.18 + const gchar *application_name, 1.19 + const gchar *application_version); 1.20 + 1.21 /* Scrolled window for the webview */ 1.22 static GtkWidget* 1.23 create_browser(GtkWidget* window, GtkWidget* urientry, GtkWidget* search, 1.24 @@ -405,11 +410,14 @@ 1.25 1.26 gtk_container_add(GTK_CONTAINER(browser), GTK_WIDGET(webview)); 1.27 1.28 - /* User agent */ 1.29 + /* Webkit settings */ 1.30 settings = webkit_web_view_get_settings (webview); 1.31 g_object_set(G_OBJECT(settings), "user-agent", useragent, NULL); 1.32 - 1.33 - /* Connect WebKit events */ 1.34 + 1.35 + if (private) 1.36 + g_object_set(G_OBJECT(settings), "enable-private-browsing", TRUE); 1.37 + 1.38 + /* Connect Webkit events */ 1.39 g_signal_connect(webview, "notify::title", 1.40 G_CALLBACK(notify_title_cb), window); 1.41 g_signal_connect(webview, "notify::progress", 1.42 @@ -548,7 +556,7 @@ 1.43 \n\ 1.44 Options:\n\ 1.45 -h --help Print TazWeb command line help\n\ 1.46 - -p --private Private browsing without cookies support\n\ 1.47 + -p --private Disable on-disk cache, cookies, history\n\ 1.48 -u --useragent [ua] Configure the user agent string\n\ 1.49 -k --kiosk Fullscreen, no bookmarks and download support\n\ 1.50 -r --raw Raw webkit window without toolbar and menu\n\ 1.51 @@ -592,12 +600,6 @@ 1.52 switch (c) { 1.53 case 0: 1.54 /* Options with flag */ 1.55 - if (debug) { 1.56 - printf ("Option: %s", long_options[index].name); 1.57 - if (optarg) 1.58 - printf (" with arg: %s", optarg); 1.59 - printf ("\n"); 1.60 - } 1.61 break; 1.62 1.63 case 'h': 1.64 @@ -609,8 +611,6 @@ 1.65 break; 1.66 1.67 case 'u': 1.68 - if (debug) 1.69 - printf ("User agent option: %s\n", optarg); 1.70 useragent = optarg; 1.71 break; 1.72 1.73 @@ -628,7 +628,7 @@ 1.74 height = 480; 1.75 break; 1.76 1.77 - case '?': 1.78 + default: 1.79 help(); 1.80 return 0; 1.81 }