summaryrefslogtreecommitdiff
path: root/src/dwb.c
diff options
context:
space:
mode:
authorportix <none@none>2013-01-07 23:39:51 +0100
committerportix <none@none>2013-01-07 23:39:51 +0100
commita086ab66867e10bc7dfc8361d4ad174b9fa76b22 (patch)
tree73e42bafbe1f6bda6c657aabea123888b4aa1048 /src/dwb.c
parent7932a6209201d03609e125ccc5280ce4dc12d2d3 (diff)
downloaddwb-a086ab66867e10bc7dfc8361d4ad174b9fa76b22.zip
Expand ~ in user-stylesheet-uri; don't throw exceptions when an argument is missing
Diffstat (limited to 'src/dwb.c')
-rw-r--r--src/dwb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dwb.c b/src/dwb.c
index d1de4d11..e6643ea3 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -55,6 +55,7 @@ static DwbStatus dwb_webview_property(GList *, WebSettings *);
static DwbStatus dwb_set_background_tab(GList *, WebSettings *);
static DwbStatus dwb_set_scripts(GList *, WebSettings *);
static DwbStatus dwb_set_user_agent(GList *, WebSettings *);
+static DwbStatus dwb_set_user_stylesheet(GList *, WebSettings *);
static DwbStatus dwb_set_startpage(GList *, WebSettings *);
static DwbStatus dwb_set_message_delay(GList *, WebSettings *);
static DwbStatus dwb_set_history_length(GList *, WebSettings *);
@@ -488,6 +489,21 @@ dwb_set_user_agent(GList *gl, WebSettings *s)
return STATUS_OK;
}/*}}}*/
+static DwbStatus
+dwb_set_user_stylesheet(GList *gl, WebSettings *s)
+{
+ char *ua = s->arg_local.p;
+ char *new = NULL;
+ if (ua)
+ s->arg_local.p = new = util_string_replace(ua, "~", g_getenv("HOME"));
+
+ dwb_webkit_setting(gl, s);
+ if (ua)
+ s->arg_local.p = ua;
+ g_hash_table_insert(dwb.settings, g_strdup("user-stylesheet-uri"), s);
+ g_free(new);
+ return STATUS_OK;
+}/*}}}*/
/* dwb_webkit_setting(GList *gl WebSettings *s) {{{*/
static DwbStatus