aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2011-03-13 21:00:25 -0600
committerGravatar Brendan Taylor <whateley@gmail.com>2011-03-13 21:00:25 -0600
commit0d9073aa31d7592ae3e7b321ac71c4b480750e08 (patch)
tree04c660632e2144d3e16a6d421128756233e1488d /src
parentcbfe2c7d9f93429a97938d2427e56fc0f4eae56c (diff)
parent964847d267ef53debae162e2be89d635ddf45c3d (diff)
Merge branch 'clear-cookies' of git://github.com/keis/uzbl into experimental
Diffstat (limited to 'src')
-rw-r--r--src/uzbl-core.c15
-rw-r--r--src/uzbl-core.h4
2 files changed, 15 insertions, 4 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index b5cbf38..c879602 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -551,7 +551,8 @@ CommandInfo cmdlist[] =
{ "include", include, TRUE },
{ "show_inspector", show_inspector, 0 },
{ "add_cookie", add_cookie, 0 },
- { "delete_cookie", delete_cookie, 0 }
+ { "delete_cookie", delete_cookie, 0 },
+ { "clear_cookies", clear_cookies, 0 }
};
void
@@ -725,6 +726,18 @@ delete_cookie(WebKitWebView *page, GArray *argv, GString *result) {
uzbl.net.soup_cookie_jar->in_manual_add = 0;
}
+
+void
+clear_cookies(WebKitWebView *page, GArray *argv, GString *result) {
+ (void) page; (void) argv; (void) result;
+
+ // Replace the current cookie jar with a new empty jar
+ soup_session_remove_feature (uzbl.net.soup_session, uzbl.net.soup_cookie_jar);
+ g_object_unref (G_OBJECT (uzbl.net.soup_cookie_jar));
+ uzbl.net.soup_cookie_jar = uzbl_cookie_jar_new ();
+ soup_session_add_feature(uzbl.net.soup_session, uzbl.net.soup_cookie_jar);
+}
+
void
act_dump_config() {
dump_config();
diff --git a/src/uzbl-core.h b/src/uzbl-core.h
index 766fe56..affd334 100644
--- a/src/uzbl-core.h
+++ b/src/uzbl-core.h
@@ -303,9 +303,6 @@ void handle_authentication (SoupSession *session,
SoupAuth *auth,
gboolean retrying,
gpointer user_data);
-void handle_cookies (SoupSession *session,
- SoupMessage *msg,
- gpointer user_data);
gboolean valid_name(const gchar* name);
void set_var(WebKitWebView *page, GArray *argv, GString *result);
void act_dump_config();
@@ -327,6 +324,7 @@ void include(WebKitWebView *page, GArray *argv, GString *result);
void show_inspector(WebKitWebView *page, GArray *argv, GString *result);
void add_cookie(WebKitWebView *page, GArray *argv, GString *result);
void delete_cookie(WebKitWebView *page, GArray *argv, GString *result);
+void clear_cookies(WebKitWebView *pag, GArray *argv, GString *result);
void builtins();
typedef void (*Command)(WebKitWebView*, GArray *argv, GString *result);