]> spindle.queued.net Git - midori/commitdiff
Mask timezone, language, architecture and plugins
authorChristian Dywan <christian@twotoasts.de>
Tue, 19 Apr 2011 21:07:22 +0000 (23:07 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 19 Apr 2011 21:07:22 +0000 (23:07 +0200)
midori/main.c
midori/midori-view.c

index cfb3683525098325b6f430096c11b08f9fe24400..41683a1b8724188951313d4c922e923951542d49 100644 (file)
@@ -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
index 14cd57197c7f15c96ddbd563a4ce4fbddd1bce2f..ade06f86a5b2d822dfac96f8c2223c6c55371c0f 100644 (file)
@@ -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);
 }