[epiphany] user-agent: Remove support for vendor branding
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] user-agent: Remove support for vendor branding
- Date: Wed, 6 Dec 2017 16:22:15 +0000 (UTC)
commit b8508aab92582b2df7cb8ec0161dedb7ff48cd27
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Wed Dec 6 10:10:04 2017 -0600
user-agent: Remove support for vendor branding
We're freezing all the version numbers in the user agent, so VendorSub
(DISTROVERSION in Debian) and vendor comment (PACKAGEVERSION) are no
longer useful. Specifying the OS is useful, but that should be done by
carefully patching WebKit as done in Fedora, not by appending the OS in
the browser information section of the user agent.
lib/ephy-user-agent.c | 62 +-----------------------------------------------
1 files changed, 2 insertions(+), 60 deletions(-)
---
diff --git a/lib/ephy-user-agent.c b/lib/ephy-user-agent.c
index 8f8efd2..728c570 100644
--- a/lib/ephy-user-agent.c
+++ b/lib/ephy-user-agent.c
@@ -25,79 +25,21 @@
#include <webkit2/webkit2.h>
-static char *
-webkit_pref_get_vendor_user_agent (void)
-{
- GKeyFile *branding_keyfile;
- char *vendor_user_agent = NULL;
-
- branding_keyfile = g_key_file_new ();
-
- if (g_key_file_load_from_file (branding_keyfile, PKGDATADIR "/branding.conf",
- G_KEY_FILE_NONE, NULL)) {
- char *vendor;
- char *vendor_sub;
- char *vendor_comment;
-
- vendor = g_key_file_get_string (branding_keyfile,
- "User Agent", "Vendor", NULL);
- vendor_sub = g_key_file_get_string (branding_keyfile,
- "User Agent", "VendorSub", NULL);
- vendor_comment = g_key_file_get_string (branding_keyfile,
- "User Agent", "VendorComment", NULL);
-
- if (vendor) {
- vendor_user_agent = g_strconcat (vendor,
- vendor_sub ? "/" : "",
- vendor_sub ? vendor_sub : "",
- vendor_comment ? " (" : "",
- vendor_comment ? vendor_comment : "",
- vendor_comment ? ")" : "",
- NULL);
- }
-
- g_free (vendor);
- g_free (vendor_sub);
- g_free (vendor_comment);
- }
-
- g_key_file_free (branding_keyfile);
-
- return vendor_user_agent;
-}
-
const char *
ephy_user_agent_get_internal (void)
{
WebKitSettings *settings;
- const char *webkit_user_agent;
- char *vendor_user_agent;
static char *user_agent = NULL;
if (user_agent)
return user_agent;
- user_agent = g_settings_get_string (EPHY_SETTINGS_WEB,
- EPHY_PREFS_WEB_USER_AGENT);
+ user_agent = g_settings_get_string (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_USER_AGENT);
if (user_agent && user_agent[0])
return user_agent;
settings = webkit_settings_new ();
- webkit_user_agent = webkit_settings_get_user_agent (settings);
- vendor_user_agent = webkit_pref_get_vendor_user_agent ();
-
- if (vendor_user_agent) {
- user_agent = g_strdup_printf ("%s %s Epiphany/%s",
- webkit_user_agent,
- vendor_user_agent,
- VERSION);
- } else {
- user_agent = g_strdup_printf ("%s Epiphany/%s",
- webkit_user_agent,
- VERSION);
- }
-
- g_free (vendor_user_agent);
+ user_agent = g_strdup_printf ("%s Epiphany/%s", webkit_settings_get_user_agent (settings), VERSION);
g_object_unref (settings);
return user_agent;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]