Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2011-02-24 Peter Kasting <pkasting@google.com>
        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * http/tests/navigation/useragent-expected.txt:
        * http/tests/navigation/useragent.php:
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * StringsNotToBeLocalized.txt:
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * WebCoreSupport/FrameLoaderClientEfl.cpp:
        (WebCore::composeUserAgent):
        * ewk/ewk_settings.cpp:
        (ewk_settings_default_user_agent_get):
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * webkit/webkitwebsettings.cpp:
        (webkitUserAgent):
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * WebView/WebView.mm:
        (+[WebView _standardUserAgentWithApplicationName:]):
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * Api/qwebpage.cpp:
        (QWebPage::userAgentForUrl):
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * WebView.cpp:
        (WebView::standardUserAgentWithApplicationName):
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * WebKitSupport/FrameLoaderClientWx.cpp:
        (WebCore::FrameLoaderClientWx::userAgent):
2011-02-24  Peter Kasting  <pkasting@google.com>

        Reviewed by Eric Seidel.

        Drop the "U; " encryption level from the User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54566

        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::standardUserAgent):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::standardUserAgent):
        * UIProcess/qt/WebPageProxyQt.cpp:
        (WebKit::WebPageProxy::standardUserAgent):
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::standardUserAgent):

Canonical link: https://commits.webkit.org/69509@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Feb 24, 2011
1 parent 6c9c2b1 commit 7117fda
Show file tree
Hide file tree
Showing 23 changed files with 120 additions and 30 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* http/tests/navigation/useragent-expected.txt:
* http/tests/navigation/useragent.php:

2011-02-24 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Yury Semikhatsky.
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/http/tests/navigation/useragent-expected.txt
@@ -1,6 +1,6 @@
Tests for user agent string template

UserAgent should match the Mozilla/5.0 (%Platform%; U; %Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) template: true
UserAgent should match the Mozilla/5.0 (%Platform%; %Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) template: true
UserAgent should be the same as the appVersion with appCodeName prefix: true
HTTP User-Agent header should be the same as userAgent: true
Language tag should not be present in the userAgent: true
Expand Down
4 changes: 2 additions & 2 deletions LayoutTests/http/tests/navigation/useragent.php
Expand Up @@ -11,8 +11,8 @@
var userAgent = navigator.userAgent;

// Validate the user agent string using the following template:
var userAgentTemplate = "Mozilla/5.0 (%Platform%; U; %Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko)"
var userAgentTemplateRegExp = /^Mozilla\/5\.0 \(.+; U; [^;]+\) AppleWebKit\/[0-9\.]+(\+)? \(KHTML, like Gecko\).*$/;
var userAgentTemplate = "Mozilla/5.0 (%Platform%; %Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko)"
var userAgentTemplateRegExp = /^Mozilla\/5\.0 \(.+; [^;]+\) AppleWebKit\/[0-9\.]+(\+)? \(KHTML, like Gecko\).*$/;
document.write("UserAgent should match the " + userAgentTemplate + " template: " + !!userAgent.match(userAgentTemplateRegExp) + "<br>");

// Validate navigator.appVersion and navigator.appCodeName
Expand Down
9 changes: 9 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,12 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* StringsNotToBeLocalized.txt:

2011-02-22 Laszlo Gombos <laszlo.1.gombos@nokia.com>

Reviewed by Alexey Proskuryakov.
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/StringsNotToBeLocalized.txt
Expand Up @@ -269,8 +269,8 @@
"MoveWordLeftAndModifySelection"
"MoveWordRight"
"MoveWordRightAndModifySelection"
"Mozilla/5.0 (Macintosh; U; "
"Mozilla/5.0 (Windows; U; "
"Mozilla/5.0 (Macintosh; "
"Mozilla/5.0 (Windows; "
"MuteButton"
"NP_GetEntryPoints"
"NP_Initialize"
Expand Down
12 changes: 12 additions & 0 deletions Source/WebKit/efl/ChangeLog
@@ -1,3 +1,15 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::composeUserAgent):
* ewk/ewk_settings.cpp:
(ewk_settings_default_user_agent_get):

2011-02-23 Patrick Gansterer <paroga@webkit.org>

Reviewed by Alexey Proskuryakov.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Expand Up @@ -117,7 +117,7 @@ static String composeUserAgent()
// Comment
ua += " (";
ua += agentPlatform(); // Platform
ua += "; U; "; // Security
ua += "; ";
ua += agentOS(); // OS-or-CPU
ua += ") ";

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/efl/ewk/ewk_settings.cpp
Expand Up @@ -329,7 +329,7 @@ const char* ewk_settings_proxy_uri_get()
const char* ewk_settings_default_user_agent_get()
{
WTF::String ua_version = makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+');
WTF::String static_ua = makeString("Mozilla/5.0 (", _ewk_settings_webkit_platform_get(), "; U; ", _ewk_settings_webkit_os_version_get(), ") AppleWebKit/", ua_version) + makeString(" (KHTML, like Gecko) Version/5.0 Safari/", ua_version);
WTF::String static_ua = makeString("Mozilla/5.0 (", _ewk_settings_webkit_platform_get(), "; ", _ewk_settings_webkit_os_version_get(), ") AppleWebKit/", ua_version) + makeString(" (KHTML, like Gecko) Version/5.0 Safari/", ua_version);

return eina_stringshare_add(static_ua.utf8().data());
}
10 changes: 10 additions & 0 deletions Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,13 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* webkit/webkitwebsettings.cpp:
(webkitUserAgent):

2011-02-24 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r79570.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/gtk/webkit/webkitwebsettings.cpp
Expand Up @@ -222,7 +222,7 @@ String webkitUserAgent()
// We re-use the WebKit version, though it doesn't seem to matter much in practice

DEFINE_STATIC_LOCAL(const String, uaVersion, (makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+')));
DEFINE_STATIC_LOCAL(const String, staticUA, (makeString("Mozilla/5.0 (", webkitPlatform(), "; U; ", webkitOSVersion(), ") AppleWebKit/", uaVersion) +
DEFINE_STATIC_LOCAL(const String, staticUA, (makeString("Mozilla/5.0 (", webkitPlatform(), "; ", webkitOSVersion(), ") AppleWebKit/", uaVersion) +
makeString(" (KHTML, like Gecko) Version/5.0 Safari/", uaVersion)));

return staticUA;
Expand Down
10 changes: 10 additions & 0 deletions Source/WebKit/mac/ChangeLog
@@ -1,3 +1,13 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* WebView/WebView.mm:
(+[WebView _standardUserAgentWithApplicationName:]):

2011-02-24 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r79570.
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/mac/WebView/WebView.mm
Expand Up @@ -548,8 +548,8 @@ + (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName
if (!webKitVersion)
webKitVersion = createUserVisibleWebKitVersionString();
if ([applicationName length])
return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@) AppleWebKit/%@ (KHTML, like Gecko) %@", osVersion, webKitVersion, applicationName];
return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@) AppleWebKit/%@ (KHTML, like Gecko)", osVersion, webKitVersion];
return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X %@) AppleWebKit/%@ (KHTML, like Gecko) %@", osVersion, webKitVersion, applicationName];
return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X %@) AppleWebKit/%@ (KHTML, like Gecko)", osVersion, webKitVersion];
}

+ (void)_reportException:(JSValueRef)exception inContext:(JSContextRef)context
Expand Down
15 changes: 4 additions & 11 deletions Source/WebKit/qt/Api/qwebpage.cpp
Expand Up @@ -3683,14 +3683,14 @@ QWebPluginFactory *QWebPage::pluginFactory() const
The default implementation returns the following value:
"Mozilla/5.0 (%Platform%; %Security%; %Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%"
"Mozilla/5.0 (%Platform%; %Security%%Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%"
On mobile platforms such as Symbian S60 and Maemo, "Mobile Safari" is used instead of "Safari".
In this string the following values are replaced at run-time:
\list
\o %Platform% and %Subplatform% are expanded to the windowing system and the operation system.
\o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true.
\o %Security% expands to "N; " if SSL is disabled.
\o %WebKitVersion% is the version of WebKit the application was compiled against.
\o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
\endlist
Expand Down Expand Up @@ -3750,15 +3750,8 @@ QString QWebPage::userAgentForUrl(const QUrl&) const

firstPartTemp += QString::fromLatin1("; ");

// SSL support
#if !defined(QT_NO_OPENSSL)
// we could check QSslSocket::supportsSsl() here, but this makes
// OpenSSL, certificates etc being loaded in all cases were QWebPage
// is used. This loading is not needed for non-https.
firstPartTemp += QString::fromLatin1("U; ");
// this may lead to a false positive: We indicate SSL since it is
// compiled in even though supportsSsl() might return false
#else
#if defined(QT_NO_OPENSSL)
// No SSL support
firstPartTemp += QString::fromLatin1("N; ");
#endif

Expand Down
10 changes: 10 additions & 0 deletions Source/WebKit/qt/ChangeLog
@@ -1,3 +1,13 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* Api/qwebpage.cpp:
(QWebPage::userAgentForUrl):

2011-02-24 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r79570.
Expand Down
10 changes: 10 additions & 0 deletions Source/WebKit/win/ChangeLog
@@ -1,3 +1,13 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* WebView.cpp:
(WebView::standardUserAgentWithApplicationName):

2011-02-24 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r79570.
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/win/WebView.cpp
Expand Up @@ -1244,8 +1244,8 @@ bool WebView::canHandleRequest(const WebCore::ResourceRequest& request)
String WebView::standardUserAgentWithApplicationName(const String& applicationName)
{
if (applicationName.isEmpty())
return makeString("Mozilla/5.0 (Windows; U; ", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Windows; U; ", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko) ", applicationName);
return makeString("Mozilla/5.0 (Windows; ", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Windows; ", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko) ", applicationName);
}

Page* WebView::page()
Expand Down
10 changes: 10 additions & 0 deletions Source/WebKit/wx/ChangeLog
@@ -1,3 +1,13 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore::FrameLoaderClientWx::userAgent):

2011-02-22 Laszlo Gombos <laszlo.1.gombos@nokia.com>

Reviewed by Alexey Proskuryakov.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
Expand Up @@ -533,7 +533,7 @@ void FrameLoaderClientWx::setTitle(const String& title, const KURL&)
String FrameLoaderClientWx::userAgent(const KURL&)
{
// FIXME: Use the new APIs introduced by the GTK port to fill in these values.
return String("Mozilla/5.0 (Macintosh; U; Intel Mac OS X) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3");
return String("Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3");
}

void FrameLoaderClientWx::dispatchDidReceiveIcon()
Expand Down
16 changes: 16 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,19 @@
2011-02-24 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

Drop the "U; " encryption level from the User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54566

* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::standardUserAgent):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::standardUserAgent):
* UIProcess/qt/WebPageProxyQt.cpp:
(WebKit::WebPageProxy::standardUserAgent):
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::standardUserAgent):

2011-02-24 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r79570.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
Expand Up @@ -32,7 +32,7 @@ namespace WebKit {
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
{
// FIXME: This should not be hard coded.
return "Mozilla/5.0 (X11; U; Linux i686) AppleWebKit/534.7 (KHTML, like Gecko) Version/5.0 Safari/534.7";
return "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.7 (KHTML, like Gecko) Version/5.0 Safari/534.7";
}

} // namespace WebKit
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Expand Up @@ -88,8 +88,8 @@ static String userVisibleWebKitVersionString()
DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));

if (applicationNameForUserAgent.isEmpty())
return makeString("Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
}

void WebPageProxy::getIsSpeaking(bool& isSpeaking)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp
Expand Up @@ -31,7 +31,7 @@ namespace WebKit {
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
{
// FIXME: This should not be hard coded.
return "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6) AppleWebKit/531.4 (KHTML, like Gecko) Version/4.0.3 Safari/531.4";
return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6) AppleWebKit/531.4 (KHTML, like Gecko) Version/4.0.3 Safari/531.4";
}

} // namespace WebKit
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp
Expand Up @@ -103,8 +103,8 @@ String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent
DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));

if (applicationNameForUserAgent.isEmpty())
return makeString("Mozilla/5.0 (Windows; U; ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Windows; U; ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
return makeString("Mozilla/5.0 (Windows; ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Windows; ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
}

} // namespace WebKit

0 comments on commit 7117fda

Please sign in to comment.