From 7152189d825d95871a87147e3a3e4b5b825de9c6 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 19 Apr 2011 23:07:22 +0200 Subject: [PATCH] Mask timezone, language, architecture and plugins --- midori/main.c | 3 +++ midori/midori-view.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/midori/main.c b/midori/main.c index cfb36835..41683a1b 100644 --- a/midori/main.c +++ b/midori/main.c @@ -2070,6 +2070,8 @@ main (int argc, g_set_application_name (_("Midori (Private Browsing)")); if (!config && !webapp) config = g_build_filename (g_get_user_config_dir (), PACKAGE_NAME, NULL); + /* Mask the timezone, which can be read by Javascript */ + g_setenv ("TZ", "UTC", TRUE); } else g_set_application_name (_("Midori")); @@ -2214,6 +2216,7 @@ main (int argc, if (private) { g_object_set (settings, + "preferred-languages", "en", #if WEBKIT_CHECK_VERSION (1, 1, 2) "enable-private-browsing", TRUE, #endif diff --git a/midori/midori-view.c b/midori/midori-view.c index 14cd5719..ade06f86 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -3169,6 +3169,24 @@ webkit_web_view_window_object_cleared_cb (GtkWidget* web_view, JSObjectRef js_window, MidoriView* view) { + #if WEBKIT_CHECK_VERSION (1, 1, 2) + if (katze_object_get_boolean (view->settings, "enable-private-browsing")) + { + /* Mask language, architecture, no plugin list */ + gchar* result = sokoke_js_script_eval (js_context, + "navigator = { 'appName': 'Netscape'," + "'appCodeName': 'Mozilla'," + "'appVersion': '5.0 (X11)'," + "'userAgent': navigator.userAgent," + "'language': 'en-US'," + "'platform': 'Linux i686'," + "'cookieEnabled': true," + "'plugins': {'refresh': function () { } } };", + NULL); + g_free (result); + } + #endif + g_signal_emit (view, signals[CONTEXT_READY], 0, js_context); } -- 2.39.5