Changeset 170009 in webkit


Ignore:
Timestamp:
Jun 16, 2014 9:20:01 AM (10 years ago)
Author:
svillar@igalia.com
Message:

[Gtk] [Stable] Fix the "Safari" part of the UA
https://bugs.webkit.org/show_bug.cgi?id=133855

Reviewed by Martin Robinson.

Source/WebCore:

We claim to be Safari (among others) to ensure maximum
compatibility with existing web sites. Since Safari 3.0 valid
Safari UA strings look like this "Version/X Safari/Y" while in our
UA it's "Safari/Y Version/6.0".

This is wrong and is causing "unsupported browser" issues in
many important sites as live.com our icloud.com.

Apart from that I'm bumping the Safari Version in the UA to 8.0 as
we're already claiming to be "Safari/538.15" which should be
pretty equivalent to Safari 8 in terms of features.

  • platform/gtk/UserAgentGtk.cpp:

(WebCore::standardUserAgent):

Tools:

Added a couple of tests to verify that the Safari part of our UA
looks like "Version/X Safari/Y" instead of "Safari/Y Version/X"
which is causing "unsupported browser" issues.

  • TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:

(testWebKitSettingsUserAgent):

  • TestWebKitAPI/Tests/WebKitGtk/testwebsettings.c:

(test_webkit_web_settings_user_agent):

Location:
releases/WebKitGTK/webkit-2.4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog

    r169331 r170009  
     12014-06-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [Gtk] [Stable] Fix the "Safari" part of the UA
     4        https://bugs.webkit.org/show_bug.cgi?id=133855
     5
     6        Reviewed by Martin Robinson.
     7
     8        We claim to be Safari (among others) to ensure maximum
     9        compatibility with existing web sites. Since Safari 3.0 valid
     10        Safari UA strings look like this "Version/X Safari/Y" while in our
     11        UA it's "Safari/Y Version/6.0".
     12
     13        This is wrong and is causing "unsupported browser" issues in
     14        many important sites as live.com our icloud.com.
     15
     16        Apart from that I'm bumping the Safari Version in the UA to 8.0 as
     17        we're already claiming to be "Safari/538.15" which should be
     18        pretty equivalent to Safari 8 in terms of features.
     19
     20        * platform/gtk/UserAgentGtk.cpp:
     21        (WebCore::standardUserAgent):
     22
    1232014-05-25  Milan Crha  <mcrha@redhat.com>
    224
  • releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.cpp

    r166484 r170009  
    7171    // sites won't load resources at all.
    7272    DEFINE_STATIC_LOCAL(const CString, uaVersion, (String::format("%i.%i", USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION).utf8()));
    73     DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (Macintosh; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s Version/6.0",
     73    DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (Macintosh; %s) AppleWebKit/%s (KHTML, like Gecko) Version/8.0 Safari/%s",
    7474        platformVersionForUAString().utf8().data(), uaVersion.data(), uaVersion.data())));
    7575
  • releases/WebKitGTK/webkit-2.4/Tools/ChangeLog

    r169375 r170009  
     12014-06-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [Gtk] [Stable] Fix the "Safari" part of the UA
     4        https://bugs.webkit.org/show_bug.cgi?id=133855
     5
     6        Reviewed by Martin Robinson.
     7
     8        Added a couple of tests to verify that the Safari part of our UA
     9        looks like "Version/X Safari/Y" instead of "Safari/Y Version/X"
     10        which is causing "unsupported browser" issues.
     11
     12        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
     13        (testWebKitSettingsUserAgent):
     14        * TestWebKitAPI/Tests/WebKitGtk/testwebsettings.c:
     15        (test_webkit_web_settings_user_agent):
     16
    1172014-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp

    r161366 r170009  
    337337    g_assert(g_strstr_len(newUserAgent, -1, "3.4.5"));
    338338    g_assert(g_strstr_len(newUserAgent, -1, "WebCatGTK+"));
     339
     340    GUniquePtr<char> applicationUserAgent(g_strdup_printf("%s %s", defaultUserAgent.data(), "WebCatGTK+/3.4.5"));
     341    g_assert_cmpstr(applicationUserAgent.get(), ==, webkit_settings_get_user_agent(settings.get()));
    339342}
    340343
  • releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKitGtk/testwebsettings.c

    r161366 r170009  
    101101    defaultUserAgent = g_strdup(webkit_web_settings_get_user_agent(settings));
    102102
     103    g_assert(g_strstr_len(defaultUserAgent, -1, "Version/8.0 Safari/"));
     104    g_assert(g_strstr_len(defaultUserAgent, -1, "Version/8.0") < g_strstr_len(defaultUserAgent, -1, "Safari/"));
     105
    103106    test_non_quirky_user_agents(settings, defaultUserAgent);
    104107
Note: See TracChangeset for help on using the changeset viewer.