summaryrefslogtreecommitdiff
path: root/src/dwb.c
diff options
context:
space:
mode:
authorAdam Ehlers Nyholm Thomsen <adament@adament.net>2012-12-11 00:18:41 +0100
committerAdam Ehlers Nyholm Thomsen <adament@adament.net>2012-12-11 00:18:41 +0100
commit307c558801ba06c3a36f88e2ae9dbe208f6a0059 (patch)
tree793044d3791aec79a782ee5f4ef5aeed672b8771 /src/dwb.c
parent944fc426af70bb926749d0273c082e5feb7b5306 (diff)
downloaddwb-307c558801ba06c3a36f88e2ae9dbe208f6a0059.zip
First version of HSTS implementation.
Diffstat (limited to 'src/dwb.c')
-rw-r--r--src/dwb.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 77317d2d..7fdb6f7f 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -48,6 +48,7 @@
#include "application.h"
#include "scripts.h"
#include "scratchpad.h"
+#include "hsts.h"
/* DECLARATIONS {{{*/
static DwbStatus dwb_webkit_setting(GList *, WebSettings *);
@@ -175,6 +176,19 @@ dwb_set_adblock(GList *gl, WebSettings *s)
}
}/*}}}*/
+void
+dwb_set_hsts(GList *gl, WebSettings *s)
+{
+ if (s->arg_local.b)
+ {
+ hsts_activate();
+ }
+ else
+ {
+ hsts_deactivate();
+ }
+}
+
/* dwb_set_cookies {{{ */
static DwbStatus
dwb_set_cookies(GList *gl, WebSettings *s) {
@@ -3460,6 +3474,7 @@ dwb_free_custom_keys()
gboolean
dwb_clean_up()
{
+ hsts_end(); /* Assumes it has access to dwb.settings */
for (GList *l = dwb.keymap; l; l=l->next) {
KeyMap *m = l->data;
if (m->map->prop & CP_SCRIPT)
@@ -3495,7 +3510,6 @@ dwb_clean_up()
for (GList *gl = dwb.state.views; gl; gl=gl->next)
view_clean(gl);
-
dwb_soup_end();
adblock_end();
@@ -4376,6 +4390,8 @@ dwb_init_files()
dwb_check_create(dwb.files[FILES_PLUGINS_ALLOW]);
dwb.files[FILES_CUSTOM_KEYS] = g_build_filename(profile_path, "custom_keys", NULL);
dwb_check_create(dwb.files[FILES_CUSTOM_KEYS]);
+ dwb.files[FILES_HSTS] = g_build_filename(profile_path, "hsts", NULL);
+ dwb_check_create(dwb.files[FILES_HSTS]);
userscripts = g_build_filename(path, "userscripts", NULL);
dwb.files[FILES_USERSCRIPTS] = util_check_directory(userscripts);
@@ -4581,6 +4597,7 @@ dwb_init()
dwb_init_hints(NULL, NULL);
dwb_soup_init();
+ hsts_init();
} /*}}}*/ /*}}}*/
/* FIFO {{{*/