[epiphany/mcatanzaro/mobile-user-agent: 17/17] Remove code to set mobile user agent
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/mobile-user-agent: 17/17] Remove code to set mobile user agent
- Date: Mon, 29 Jun 2020 17:23:23 +0000 (UTC)
commit 3155e00502425f105a528296f0c103db608a59e0
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Jun 29 09:59:58 2020 -0500
Remove code to set mobile user agent
Apparently this never worked properly and needs to be done in WebKit
instead. See:
https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/601#note_853104
lib/ephy-user-agent.c | 48 ++----------------------------------------------
lib/ephy-user-agent.h | 1 -
src/ephy-shell.c | 2 --
3 files changed, 2 insertions(+), 49 deletions(-)
---
diff --git a/lib/ephy-user-agent.c b/lib/ephy-user-agent.c
index 631005193..52cbc8282 100644
--- a/lib/ephy-user-agent.c
+++ b/lib/ephy-user-agent.c
@@ -26,53 +26,10 @@
#include <webkit2/webkit2.h>
-static gboolean mobile_user_agent = FALSE;
-static char *user_agent = NULL;
-
-void
-ephy_user_agent_init_sync (void)
-{
- g_autoptr (GError) error = NULL;
- g_autoptr (GDBusConnection) connection = NULL;
- g_autoptr (GVariant) var = NULL;
- g_autoptr (GVariant) v = NULL;
- const char *chassis;
-
- connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
- if (!connection) {
- g_debug ("Could not connect to system bus: %s", error->message);
- return;
- }
-
- var = g_dbus_connection_call_sync (connection,
- "org.freedesktop.hostname1",
- "/org/freedesktop/hostname1",
- "org.freedesktop.DBus.Properties",
- "Get",
- g_variant_new ("(ss)",
- "org.freedesktop.hostname1",
- "Chassis"),
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error);
-
- if (!var) {
- g_debug ("Could not access chassis property: %s", error->message);
- return;
- }
-
- g_variant_get (var, "(v)", &v);
- chassis = g_variant_get_string (v, NULL);
- mobile_user_agent = g_strcmp0 (chassis, "handset") == 0;
-
- g_clear_pointer (&user_agent, g_free);
-}
-
const char *
ephy_user_agent_get (void)
{
+ static char *user_agent = NULL;
WebKitSettings *settings;
gboolean web_app;
@@ -89,9 +46,8 @@ ephy_user_agent_get (void)
web_app = ephy_profile_dir_is_web_application ();
settings = webkit_settings_new ();
- user_agent = g_strdup_printf ("%s%s%s",
+ user_agent = g_strdup_printf ("%s%s",
webkit_settings_get_user_agent (settings),
- mobile_user_agent ? " Mobile" : "",
web_app ? " (Web App)" : "");
g_object_unref (settings);
diff --git a/lib/ephy-user-agent.h b/lib/ephy-user-agent.h
index ce57b5315..353bbbb49 100644
--- a/lib/ephy-user-agent.h
+++ b/lib/ephy-user-agent.h
@@ -25,6 +25,5 @@
G_BEGIN_DECLS
const char *ephy_user_agent_get (void);
-void ephy_user_agent_init_sync (void);
G_END_DECLS
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 91be64ef3..73a77cbea 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -40,7 +40,6 @@
#include "ephy-title-box.h"
#include "ephy-title-widget.h"
#include "ephy-type-builtins.h"
-#include "ephy-user-agent.h"
#include "ephy-web-app-utils.h"
#include "ephy-web-view.h"
#include "ephy-window.h"
@@ -481,7 +480,6 @@ ephy_shell_startup (GApplication *application)
hdy_init ();
/* We're not remoting; start our services */
- ephy_user_agent_init_sync ();
mode = ephy_embed_shell_get_mode (embed_shell);
if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]