[hackers][surf] Adds a WebKitWebSettings wrapper to use in config. || Aner

From: <aner.lucero_AT_gmail.com>
Date: Mon, 1 Feb 2010 15:27:08 -0800

changeset: 175:c54ca022ce40
tag: tip
user: Aner
date: Mon Feb 01 13:25:01 2010 -0300
summary: Adds a WebKitWebSettings wrapper to use in config.h

diff -r 1b039f93180a -r c54ca022ce40 config.def.h
--- a/config.def.h Fri Jan 29 09:44:14 2010 +0100
+++ b/config.def.h Mon Feb 01 13:25:01 2010 -0300
@@ -45,3 +45,9 @@
     { "Copy URI", clipboard, { .b = FALSE } },
     { "Download", download, { 0 } },
 };
+
+static BooleanFlags booleanFlags[] = {
+ { "enable-scripts", FALSE },
+ { "enable-pulgins", FALSE },
+ { "enable-private-browsing", TRUE },
+};
diff -r 1b039f93180a -r c54ca022ce40 surf.c
--- a/surf.c Fri Jan 29 09:44:14 2010 +0100
+++ b/surf.c Mon Feb 01 13:25:01 2010 -0300
@@ -54,6 +54,11 @@
         const Arg arg;
 } Key;
 
+typedef struct booleanFlag {
+ gchar *name;
+ gboolean value;
+} BooleanFlag;
+
 static Display *dpy;
 static Atom uriprop, findprop;
 static SoupCookieJar *cookies;
@@ -558,6 +563,11 @@
         g_object_set(G_OBJECT(settings), "user-agent", ua, NULL);
         uri = g_strconcat("file://", stylefile, NULL);
         g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
+
+ for( i = 0; i < LENGTH(booleanFlags); i++ ) {
+ g_object_set(G_OBJECT(settings), booleanFlags[i].name ,booleanFlags[i].vale, NULL );
+ }
+
         g_free(uri);
         setatom(c, findprop, "");
         setatom(c, uriprop, "");
Received on Mon Feb 01 2010 - 23:27:08 UTC

This archive was generated by hypermail 2.2.0 : Mon Feb 01 2010 - 18:24:10 UTC