diff options
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | browser.c | 11 |
2 files changed, 15 insertions, 0 deletions
@@ -230,6 +230,10 @@ following environment variables: ("homepage" or "new window") and if no URIs are specified on the command line. Defaults to "about:blank". + LARIZA_USER_AGENT + Lariza will identify itself with this string. See source code + for the default value. + LARIZA_ZOOM Zoom level for WebKit viewports. Defaults to 1.0. @@ -83,6 +83,10 @@ static gboolean language_is_set = FALSE; static gchar *search_text = NULL; static gboolean show_all_requests = FALSE; static gboolean tabbed_automagic = TRUE; +static gchar *user_agent = "Mozilla/5.0 (X11; U; Unix; en-US) " + "AppleWebKit/537.15 (KHTML, like Gecko) " + "Chrome/24.0.1295.0 " + "Safari/537.15 "__NAME_UPPERCASE__"/git"; void @@ -263,6 +267,9 @@ client_new(const gchar *uri) language_is_set = TRUE; } + g_object_set(G_OBJECT(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(c->web_view))), + "user-agent", user_agent, NULL); + c->scroll = gtk_scrolled_window_new(NULL, NULL); gtk_container_add(GTK_CONTAINER(c->scroll), c->web_view); @@ -569,6 +576,10 @@ grab_environment_configuration(void) if (e != NULL) home_uri = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_USER_AGENT"); + if (e != NULL) + user_agent = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_ZOOM"); if (e != NULL) global_zoom = atof(e); |