From 3fd11ce4830ca4ff03479478bfd6ad0ce80c7eed Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 19 Jul 2022 14:27:07 +0300 Subject: goodwolf: Added the switch -j for enabling JavaScript by default for all tabs --- goodwolf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/goodwolf.c b/goodwolf.c index cb0b1b2..2ae2f85 100644 --- a/goodwolf.c +++ b/goodwolf.c @@ -34,6 +34,7 @@ static gboolean alt_useragent = false; static int custom_favicon_size = 30; static gboolean persistent_storage = false; static gboolean separated_storage = false; +static gboolean enabled_javascript = false; static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, @@ -809,7 +810,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b webkit_settings_set_user_agent(settings, "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:74.0) Gecko/20100101 Firefox/74.0"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(browser->javascript), - webkit_settings_get_enable_javascript_markup(settings)); + webkit_settings_get_enable_javascript_markup(settings) || enabled_javascript); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(browser->auto_load_images), webkit_settings_get_auto_load_images(settings)); @@ -1156,6 +1157,7 @@ main(int argc, char *argv[]) printf("\ goodwolf [OPTIONS] [URLs]\n\n\ Options:\n\ +-j JavaScript is enabled by default for all tabs\n\ -s DD Specifies a custom favicon size, where DD is a two digit number\n\ -nl Tabs won't have a label (page title)\n\ -cl Tabs will have a context label (text that identifies every tab)\n\ @@ -1291,6 +1293,8 @@ Options:\n\ persistent_storage = TRUE; else if (argv[1][1] == 'g') separated_storage = TRUE; + else if (argv[1][1] == 'j') + enabled_javascript = TRUE; else if (argv[1][1] == 's') { argv++; argc--; -- cgit v1.3.1-23-gd82d