Skip to content

Commit

Permalink
Go back to using WebKit-provided user agent
Browse files Browse the repository at this point in the history
As of midori-browser#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: midori-browser#160
  • Loading branch information
kalikiana committed Nov 19, 2018
1 parent 94cf91f commit 4438072
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion config.h.in
Expand Up @@ -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@"
Expand Down
2 changes: 1 addition & 1 deletion core/tab.vala
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion 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;
Expand Down

0 comments on commit 4438072

Please sign in to comment.