diff options
author | Christian Dywan <christian@twotoasts.de> | 2018-09-05 16:39:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-05 16:39:25 +0200 |
commit | 71fc5286ca718d636e13215d069605835f4933f6 (patch) | |
tree | 1cbe7e08f1788a269577b52113a3b37afd7a6b7b | |
parent | 76f9abf9fd257ddc7b83a18dc80b98735c24b13a (diff) | |
download | midori-git-71fc5286ca718d636e13215d069605835f4933f6.tar.gz |
Identify as Chrome in the user agent (#21)
The default user agent supplied by WebKit is based on Safari. By replacing the `Version/11.0` part we can get a result that looks like Chrome.
-rw-r--r-- | core/tab.vala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/tab.vala b/core/tab.vala index 7c175447..3330ddb3 100644 --- a/core/tab.vala +++ b/core/tab.vala @@ -50,9 +50,11 @@ namespace Midori { string? uri = null, string? title = null) { Object (related_view: related, web_context: web_context, visible: true); - get_settings ().set_user_agent_with_application_details ( + var settings = get_settings (); + settings.set_user_agent_with_application_details ( Config.PROJECT_NAME, Config.CORE_VERSION); - get_settings ().enable_developer_extras = true; + settings.user_agent = settings.user_agent.replace ("Version/11.0", "Chrome/55.0.2876.0"); + settings.enable_developer_extras = true; if (pinned) { load_uri (uri ?? "internal:speed-dial"); |