summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2018-11-20 12:52:23 +0200
committerGitHub <noreply@github.com>2018-11-20 12:52:23 +0200
commit08454b5dbd58576a6d3390a4f20496a6eabf9a17 (patch)
tree28b08c0b32ebb0309956640c741388d9ae5cddd2
parentc5c6540663ceb1a82bc38ac4a5ce314fd0dc8c6d (diff)
downloadmidori-git-08454b5dbd58576a6d3390a4f20496a6eabf9a17.tar.gz
Go back to using WebKit-provided user agent (#173)
As of #49 the user agent was hard-coded in an effort to reduce fingerprinting. Unfortunately this breaks websites such as YouTube which incorrectly sniff for features. The Midori version can remain decoupled. Fixes: #160
-rw-r--r--CMakeLists.txt4
-rw-r--r--config.h.in2
-rw-r--r--core/tab.vala2
-rw-r--r--vapi/config.vapi2
4 files changed, 4 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 077bd441..913b07ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,9 +68,7 @@ set(CFLAGS "${CFLAGS} -g")
set(VALA_CFLAGS "-g -fPIC -w -Werror")
set(LIBCORE "${CMAKE_PROJECT_NAME}-core")
-set(CORE_OS "(X11; Linux x86_64)")
-set(CORE_ENGINE "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36")
-set(CORE_USER_AGENT "Mozilla/5.0 ${CORE_OS} ${CORE_ENGINE} Midori/6")
+set(CORE_USER_AGENT_VERSION "Midori/6")
configure_file(config.h.in config.h @ONLY)
diff --git a/config.h.in b/config.h.in
index b39a0269..77b341ca 100644
--- a/config.h.in
+++ b/config.h.in
@@ -10,7 +10,7 @@
*/
#cmakedefine CORE_VERSION "@CORE_VERSION@"
-#cmakedefine CORE_USER_AGENT "@CORE_USER_AGENT@"
+#cmakedefine CORE_USER_AGENT_VERSION "@CORE_USER_AGENT_VERSION@"
#cmakedefine PROJECT_NAME "@CMAKE_PROJECT_NAME@"
#cmakedefine PROJECT_BUGS "@PROJECT_BUGS@"
#cmakedefine PROJECT_WEBSITE "@PROJECT_WEBSITE@"
diff --git a/core/tab.vala b/core/tab.vala
index 79602e1f..fe8cf0a7 100644
--- a/core/tab.vala
+++ b/core/tab.vala
@@ -60,7 +60,7 @@ namespace Midori {
Object (related_view: related, web_context: web_context, visible: true);
var settings = get_settings ();
- settings.user_agent = Config.CORE_USER_AGENT;
+ settings.user_agent += " %s".printf (Config.CORE_USER_AGENT_VERSION);
settings.enable_developer_extras = true;
var core_settings = CoreSettings.get_default ();
settings.enable_javascript = core_settings.enable_javascript;
diff --git a/vapi/config.vapi b/vapi/config.vapi
index b1d0979d..be2fb47f 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -1,7 +1,7 @@
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Config {
public const string CORE_VERSION;
- public const string CORE_USER_AGENT;
+ public const string CORE_USER_AGENT_VERSION;
public const string PROJECT_NAME;
public const string PROJECT_BUGS;
public const string PROJECT_WEBSITE;