summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2018-09-10 14:53:29 +0200
committerChristian Dywan <christian@twotoasts.de>2018-09-10 14:53:29 +0200
commitf118ab6d7f15a321a1ac821287f7614bf31bbf3b (patch)
tree40deba99ee03f40e15d47013ff2d92abb9b3f678
parent2e94e9866b42e2ccf7cd0fa7677b7ecb11de151f (diff)
downloadmidori-git-generic-user-agent.tar.gz
Configure exact user agent to reduce fingerprintinggeneric-user-agent
-rw-r--r--CMakeLists.txt3
-rw-r--r--config.h.in1
-rw-r--r--core/tab.vala4
-rw-r--r--vapi/config.vapi1
4 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1ae0918..b12a05a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,9 @@ 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")
configure_file(config.h.in config.h @ONLY)
diff --git a/config.h.in b/config.h.in
index ec23bbcd..1fd7c3bd 100644
--- a/config.h.in
+++ b/config.h.in
@@ -10,6 +10,7 @@
*/
#cmakedefine CORE_VERSION "@CORE_VERSION@"
+#cmakedefine CORE_USER_AGENT "@CORE_USER_AGENT@"
#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 e920d864..5bb4e492 100644
--- a/core/tab.vala
+++ b/core/tab.vala
@@ -56,9 +56,7 @@ namespace Midori {
Object (related_view: related, web_context: web_context, visible: true);
var settings = get_settings ();
- settings.set_user_agent_with_application_details (
- Config.PROJECT_NAME, Config.CORE_VERSION);
- settings.user_agent = settings.user_agent.replace ("Version/11.0", "Chrome/55.0.2876.0");
+ settings.user_agent = Config.CORE_USER_AGENT;
settings.enable_developer_extras = true;
if (pinned) {
diff --git a/vapi/config.vapi b/vapi/config.vapi
index b966df29..200c129c 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -1,6 +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 PROJECT_NAME;
public const string PROJECT_BUGS;
public const string PROJECT_WEBSITE;