summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2013-01-27 23:09:17 +0100
committerportix <none@none>2013-01-27 23:09:17 +0100
commit3f9e17180eaac20a37a0c3594293c0f916f8ab8b (patch)
tree35288be5ddcce1fdc4e794c8282120776696bc72 /src
parent046a50d2352d3a517f03054f54f24fdb5636ec21 (diff)
downloaddwb-3f9e17180eaac20a37a0c3594293c0f916f8ab8b.zip
New option 'accept-language'
Diffstat (limited to 'src')
-rw-r--r--src/config.h2
-rw-r--r--src/dwb.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
index 81c6cb09..9f126c95 100644
--- a/src/config.h
+++ b/src/config.h
@@ -1170,4 +1170,6 @@ static WebSettings DWB_SETTINGS[] = {
SETTING_GLOBAL, BOOLEAN, { .b = false }, NULL, { 0 }, },
{ { "print-previewer", "Command used for the printing preview", },
SETTING_GLOBAL, CHAR, { .p = NULL }, NULL, { 0 }, },
+ { { "accept-language", "If set will be used for 'Accept-Language' header in all requests", },
+ SETTING_GLOBAL | SETTING_ONINIT, CHAR, { .p = NULL }, (S_Func)dwb_set_accept_language, { 0 }, },
};/*}}}*/
diff --git a/src/dwb.c b/src/dwb.c
index d54c84a6..2ec0fbba 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -77,6 +77,7 @@ static DwbStatus dwb_set_ntlm(GList *gl, WebSettings *s);
static DwbStatus dwb_set_find_delay(GList *gl, WebSettings *s);
static DwbStatus dwb_set_do_not_track(GList *gl, WebSettings *s);
static DwbStatus dwb_set_show_single_tab(GList *gl, WebSettings *s);
+static DwbStatus dwb_set_accept_language(GList *gl, WebSettings *s);
#ifdef WITH_LIBSOUP_2_38
static DwbStatus dwb_set_dns_lookup(GList *gl, WebSettings *s);
#endif
@@ -175,6 +176,14 @@ dwb_set_adblock(GList *gl, WebSettings *s)
}
}/*}}}*/
+/*{{{*/
+static DwbStatus
+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;
+}/*}}}*/
+
/* dwb_set_cookies {{{ */
static DwbStatus
dwb_set_cookies(GList *gl, WebSettings *s) {