From 82af15d3533a143fac02c80f1405e8843d1d0f4e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 19 Jun 2022 13:40:16 +0300 Subject: badwolf: Added a switch for alternative useragent --- badwolf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 8551035..52878db 100644 --- a/badwolf.c +++ b/badwolf.c @@ -29,7 +29,8 @@ GtkTreeModel *bookmarks_completion_model; static gboolean tabs_no_label = false; static gboolean tabs_constant = false; static gboolean tray_enabled = false; -static int custom_favicon_size = 0; +static gboolean alt_useragent = false; +static int custom_favicon_size = 30; static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, @@ -770,6 +771,8 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b } WebKitSettings *settings = webkit_settings_new_with_settings(BADWOLF_WEBKIT_SETTINGS); + if (alt_useragent == TRUE) + webkit_settings_set_user_agent(settings, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(browser->javascript), webkit_settings_get_enable_javascript_markup(settings)); @@ -1228,6 +1231,8 @@ main(int argc, char *argv[]) tabs_constant = TRUE; if (argv[1][1] == 't') tray_enabled = TRUE; + if (argv[1][1] == 'u') + alt_useragent = TRUE; if (argv[1][1] == 's') { argv++; argc--; -- cgit v1.3.1-23-gd82d