Skip to content
Permalink
Browse files

add a new config option js_auto_open_windows = 0|1, default being 1.

If enabled (the default), javascripts will be allowed to automatically
open windows (popups) based on the current browser_mode setting.  This
is the current behavior.

If disabled (set to 0), the automatic opening of windows will never be
allowed, even if the site is whitelisted.
  • Loading branch information...
dajohi committed Jun 8, 2013
1 parent d97efbe commit cb5918907e6c89b520743067b81ebabebae888cd
Showing with 13 additions and 5 deletions.
  1. +2 −1 settings.c
  2. +1 −1 whitelist.c
  3. +5 −0 xombrero.1
  4. +3 −3 xombrero.c
  5. +1 −0 xombrero.conf
  6. +1 −0 xombrero.h
@@ -121,7 +121,7 @@ int allow_insecure_scripts = XT_DS_ALLOW_INSECURE_SCRIPTS;
int do_not_track = XT_DS_DO_NOT_TRACK;
int preload_strict_transport = XT_DS_PRELOAD_STRICT_TRANSPORT;
char *gnutls_priority_string = XT_DS_GNUTLS_PRIORITY_STRING;

int js_auto_open_windows = 1;
char *cmd_font_name = NULL; /* these are all set at startup */
char *oops_font_name = NULL;
char *statusbar_font_name = NULL;
@@ -546,6 +546,7 @@ struct settings rs[] = {
{ "http_proxy_starts_enabled", XT_S_BOOL, 0, &http_proxy_starts_enabled, NULL, NULL, NULL, NULL, check_http_proxy_starts_enabled, TT_HTTP_PROXY_STARTS_ENABLED },
{ "icon_size", XT_S_INT, 0, &icon_size, NULL, NULL, NULL, NULL, check_icon_size, TT_ICON_SIZE },
{ "include_config", XT_S_STR, XT_SF_INVISIBLE, NULL, &include_config, NULL, NULL, NULL, NULL },
{ "js_auto_open_windows", XT_S_BOOL, 1, &js_auto_open_windows, NULL, NULL, NULL, NULL, NULL, TT_JS_AUTO_OPEN_WINDOWS },
{ "max_connections", XT_S_INT, XT_SF_RESTART,&max_connections, NULL, NULL, NULL, NULL, check_max_connections, TT_MAX_CONNECTIONS },
{ "max_host_connections", XT_S_INT, XT_SF_RESTART,&max_host_connections, NULL, NULL, NULL, NULL, check_max_host_connections, TT_MAX_HOST_CONNECTIONS },
{ "oops_font", XT_S_STR, 0, NULL, &oops_font_name, NULL, NULL, set_oops_font, check_oops_font, TT_OOPS_FONT },
@@ -472,7 +472,7 @@ toggle_js(struct tab *t, struct karg *args)
g_object_set(G_OBJECT(t->settings),
"enable-scripts", es, (char *)NULL);
g_object_set(G_OBJECT(t->settings),
"javascript-can-open-windows-automatically", es, (char *)NULL);
"javascript-can-open-windows-automatically", js_auto_open_windows ? es : 0, (char *)NULL);
webkit_web_view_set_settings(t->wv, t->settings);

if (args->i & XT_WL_RELOAD)
@@ -1422,6 +1422,11 @@ configuration file is not pertinent to these database settings.
.Pp
This feature is likely best used as the last item in
.Pa ~/.xombrero.conf .
.It Cm js_auto_open_windows
If enabled, javascripts will be allowed to automatically open windows
based on the current
.Cm browser_mode .
If disabled, it will never be allowed. The default setting is 1 (enabled).
.It Cm js_wl
This is a Java Script whitelist item.
See
@@ -3630,7 +3630,7 @@ 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", es, (char *)NULL);
"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,
@@ -6868,8 +6868,8 @@ setup_webkit(struct tab *t)
g_object_set(G_OBJECT(t->settings),
"enable-plugins", enable_plugins, (char *)NULL);
g_object_set(G_OBJECT(t->settings),
"javascript-can-open-windows-automatically", enable_scripts,
(char *)NULL);
"javascript-can-open-windows-automatically",
js_auto_open_windows ? enable_scripts : 0, (char *)NULL);
g_object_set(G_OBJECT(t->settings),
"enable-html5-database", FALSE, (char *)NULL);
g_object_set(G_OBJECT(t->settings),
@@ -63,6 +63,7 @@
# referer = always
# warn_cert_changes = 1
# enable_cache = 1
# js_auto_open_windows = 0

# See http://www.xroxy.com/proxylist.php for a good list of open
# proxies.
@@ -964,6 +964,7 @@ extern int do_not_track;
extern int preload_strict_transport;
extern char *gnutls_priority_string;
extern int anonymize_headers;
extern int js_auto_open_windows;

/* globals */
extern void (*os_init)(void);

0 comments on commit cb59189

Please sign in to comment.
You can’t perform that action at this time.