diff options
author | portix <none@none> | 2013-02-13 17:17:31 +0100 |
---|---|---|
committer | portix <none@none> | 2013-02-13 17:17:31 +0100 |
commit | 63aa3150c4995d4796b7a1addb9857dac8312f10 (patch) | |
tree | 1c8440ee39ec097f2e80c317d199426912d2599d /src/dwb.c | |
parent | 812f33cea81d2ae783f37fa0644f701158ec1a8f (diff) | |
parent | 71e7fca012aaaf750fefafebd4de728b727042b2 (diff) | |
download | dwb-63aa3150c4995d4796b7a1addb9857dac8312f10.zip |
Merging hsts into default
Diffstat (limited to 'src/dwb.c')
-rw-r--r-- | src/dwb.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -48,6 +48,7 @@ #include "application.h" #include "scripts.h" #include "dom.h" +#include "hsts.h" /* DECLARATIONS {{{*/ static DwbStatus dwb_webkit_setting(GList *, WebSettings *); @@ -177,6 +178,18 @@ dwb_set_accept_language(GList *gl, WebSettings *s) g_object_set(webkit_get_default_session(), "accept-language", s->arg_local.p, NULL); return STATUS_OK; }/*}}}*/ +void +dwb_set_hsts(GList *gl, WebSettings *s) +{ + if (s->arg_local.b) + { + hsts_activate(); + } + else + { + hsts_deactivate(); + } +} /* dwb_set_cookies {{{ */ static DwbStatus @@ -3279,8 +3292,8 @@ dwb_clean_up() // 'execute' can crash scripts_end(); - for (GList *l = dwb.keymap; l; l=l->next) - { + 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) scripts_unbind(m->map->arg.p); @@ -4203,6 +4216,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); @@ -4408,6 +4423,7 @@ dwb_init() dwb_init_hints(NULL, NULL); dwb_soup_init(); + hsts_init(); } /*}}}*/ /*}}}*/ /* FIFO {{{*/ |