Skip to content

Commit

Permalink
Configure exact user agent to reduce fingerprinting (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalikiana committed Sep 12, 2018
1 parent 1245e9c commit ee39941
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions config.h.in
Expand Up @@ -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@"
Expand Down
4 changes: 1 addition & 3 deletions core/tab.vala
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions 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;
Expand Down

0 comments on commit ee39941

Please sign in to comment.