about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@conformal.com>2013-06-10 11:35:43 -0400
committerJosh Rickmar <jrick@conformal.com>2013-06-10 16:15:10 -0400
commit4a56bee3157eb964e187ac7eece757a1cae40867 (patch)
tree5519f24b95e3191407a73beeee686a7a0ffe53c9
parentfb538d52eafd1afeee35e43bdaffdfd1465ccbda (diff)
downloadxombrero-4a56bee3157eb964e187ac7eece757a1cae40867.tar.gz
Fix runtime set so it actually sets something
Disabling at runtime looks to work, but enabling it again seems to
only take effect on open tabs once the page is reloaded.  webkit bug?
-rw-r--r--settings.c5
-rw-r--r--xombrero.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/settings.c b/settings.c
index dcf6705..0f91807 100644
--- a/settings.c
+++ b/settings.c
@@ -2610,6 +2610,7 @@ set_js_auto_open_windows(char *value)
 {
 	int		tmp;
 	const char	*errstr;
+	struct tab	*t;
 
 	if (value == NULL || strlen(value) == 0)
 		js_auto_open_windows = XT_DS_JS_AUTO_OPEN_WINDOWS;
@@ -2619,6 +2620,10 @@ set_js_auto_open_windows(char *value)
 			return (-1);
 		js_auto_open_windows = tmp;
 	}
+	TAILQ_FOREACH(t, &tabs, entry)
+		g_object_set(G_OBJECT(t->settings),
+		    "javascript-can-open-windows-automatically",
+		    js_auto_open_windows, NULL);
 	return (0);
 }
 
diff --git a/xombrero.c b/xombrero.c
index 924220c..b989cad 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -3629,8 +3629,6 @@ check_and_set_js(const gchar *uri, struct tab *t)
 
 	g_object_set(G_OBJECT(t->settings),
 	    "enable-scripts", es, (char *)NULL);
-	g_object_set(G_OBJECT(t->settings),
-	    "javascript-can-open-windows-automatically", js_auto_open_windows ? es : 0, (char *)NULL);
 	webkit_web_view_set_settings(t->wv, t->settings);
 
 	button_set_stockid(t->js_toggle,
@@ -6869,7 +6867,7 @@ setup_webkit(struct tab *t)
 	    "enable-plugins", enable_plugins, (char *)NULL);
 	g_object_set(G_OBJECT(t->settings),
 	    "javascript-can-open-windows-automatically",
-	    js_auto_open_windows ? enable_scripts : 0, (char *)NULL);
+	    js_auto_open_windows, (char *)NULL);
 	g_object_set(G_OBJECT(t->settings),
 	    "enable-html5-database", FALSE, (char *)NULL);
 	g_object_set(G_OBJECT(t->settings),