From bb9c9873390717382741d28cb591fc192d71e8cf Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 14 May 2012 09:30:52 -0400 Subject: Make enable_js_autorun a runtime setting. Missed this one before as it wasn't mentioned in the manpage. --- settings.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/settings.c b/settings.c index ac305d0..8dd29fc 100644 --- a/settings.c +++ b/settings.c @@ -136,6 +136,7 @@ int set_default_script(struct settings *, char *); int set_default_script_rt(char *); int set_default_zoom_level(char *); int set_enable_cookie_whitelist(char *); +int set_enable_js_autorun(char *); int set_enable_js_whitelist(char *); int set_enable_localstorage(char *); int set_enable_plugins(char *); @@ -356,7 +357,7 @@ struct settings rs[] = { { "history_autosave", XT_S_INT, 0, &history_autosave, NULL, NULL, NULL, NULL }, { "http_proxy", XT_S_STR, 0, NULL, &http_proxy, NULL, NULL, set_http_proxy }, { "icon_size", XT_S_INT, 0, &icon_size, NULL, NULL, NULL, NULL }, - { "enable_js_autorun", XT_S_INT, 0, &enable_js_autorun, NULL, NULL, NULL, NULL }, + { "enable_js_autorun", XT_S_INT, 0, &enable_js_autorun, NULL, NULL, NULL, set_enable_js_autorun }, { "max_connections", XT_S_INT, XT_SF_RESTART,&max_connections, NULL, NULL, NULL, NULL }, { "max_host_connections", XT_S_INT, XT_SF_RESTART,&max_host_connections, NULL, NULL, NULL, NULL }, { "read_only_cookies", XT_S_INT, 0, &read_only_cookies, NULL, NULL, NULL, set_read_only_cookies }, @@ -1333,6 +1334,19 @@ set_enable_cookie_whitelist(char *value) return (0); } +int +set_enable_js_autorun(char *value) +{ + int tmp; + const char *errstr; + + tmp = strtonum(value, 0, 1, &errstr); + if (errstr) + return (-1); + enable_js_autorun = tmp; + return (0); +} + int set_enable_js_whitelist(char *value) { -- cgit 1.4.1-2-gfad0