[devhelp] Disable some WebKit features we don't need



commit 55e425cbd224e10dd586518863e81281b2de5690
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Fri Mar 13 11:43:48 2015 -0500

    Disable some WebKit features we don't need
    
    Avoid weird crashes like
    https://bugzilla.redhat.com/show_bug.cgi?id=1201823 which should not be
    happening at all, because developer documentation does not need HTML5
    local storage.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746166

 src/dh-window.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-window.c b/src/dh-window.c
index 91d463f..b5f6149 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -1188,6 +1188,18 @@ window_web_view_tab_accel_cb (GtkAccelGroup   *accel_group,
         }
 }
 
+static void
+apply_webview_settings (WebKitWebView *view)
+{
+        /* Disable some things we have no need for */
+        g_object_set (webkit_web_view_get_settings (view),
+                      "enable-html5-database", FALSE,
+                      "enable-html5-local-storage", FALSE,
+                      "enable-javascript", FALSE,
+                      "enable-plugins", FALSE,
+                      NULL);
+}
+
 static int
 window_open_new_tab (DhWindow    *window,
                      const gchar *location,
@@ -1206,6 +1218,7 @@ window_open_new_tab (DhWindow    *window,
 
         /* Prepare the web view */
         view = webkit_web_view_new ();
+        apply_webview_settings (WEBKIT_WEB_VIEW (view));
         gtk_widget_show (view);
         /* get the current fonts and set them on the new view */
         dh_settings_get_selected_fonts (priv->settings, &font_fixed, &font_variable);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]