Skip to content
Permalink
Browse files
2011-03-03 Peter Kasting <pkasting@google.com>
        Reviewed by James Robinson.

        Drop redundant "Windows; " from the Windows-specific User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54567

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

        Reviewed by James Robinson.

        Drop redundant "Windows; " from the Windows-specific User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54567

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

        Reviewed by James Robinson.

        Drop redundant "Windows; " from the Windows-specific User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54567

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

        Reviewed by James Robinson.

        Drop redundant "Windows; " from the Windows-specific User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54567

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

        Reviewed by James Robinson.

        Drop redundant "Windows; " from the Windows-specific User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54567

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

        Reviewed by James Robinson.

        Drop redundant "Windows; " from the Windows-specific User Agent string.
        https://bugs.webkit.org/show_bug.cgi?id=54567

        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::standardUserAgent):

Canonical link: https://commits.webkit.org/70113@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Mar 3, 2011
1 parent 122ce6c commit 6e5a90b0944e6cef49c8433178ef9be86eab0bcc
Showing 13 changed files with 90 additions and 29 deletions.
@@ -1,3 +1,13 @@
2011-03-03 Peter Kasting <pkasting@google.com>

Reviewed by James Robinson.

Drop redundant "Windows; " from the Windows-specific User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54567

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

2011-03-03 Peter Varga <pvarga@webkit.org>

Reviewed by Oliver Hunt.
@@ -1,6 +1,6 @@
Tests for user agent string template

UserAgent should match the Mozilla/5.0 (%Platform%; %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
@@ -11,8 +11,8 @@
var userAgent = navigator.userAgent;

// Validate the user agent string using the following template:
var userAgentTemplate = "Mozilla/5.0 (%Platform%; %Subplatform%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko)"
var userAgentTemplateRegExp = /^Mozilla\/5\.0 \(.+; [^;]+\) 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
@@ -1,3 +1,12 @@
2011-03-03 Peter Kasting <pkasting@google.com>

Reviewed by James Robinson.

Drop redundant "Windows; " from the Windows-specific User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54567

* StringsNotToBeLocalized.txt:

2011-03-03 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.
@@ -270,7 +270,7 @@
"MoveWordRight"
"MoveWordRightAndModifySelection"
"Mozilla/5.0 (Macintosh; "
"Mozilla/5.0 (Windows; "
"Mozilla/5.0 ("
"MuteButton"
"NP_GetEntryPoints"
"NP_Initialize"
@@ -1,3 +1,14 @@
2011-03-03 Peter Kasting <pkasting@google.com>

Reviewed by James Robinson.

Drop redundant "Windows; " from the Windows-specific User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54567

* webkit/webkitwebsettings.cpp:
(webkitPlatform):
(webkitUserAgent):

2011-03-02 Martin Robinson <mrobinson@igalia.com>

Reviewed by Xan Lopez.
@@ -171,15 +171,15 @@ enum {
static String webkitPlatform()
{
#if PLATFORM(X11)
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("X11")));
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("X11; ")));
#elif OS(WINDOWS)
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Windows")));
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("")));
#elif PLATFORM(MAC)
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Macintosh")));
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Macintosh; ")));
#elif defined(GDK_WINDOWING_DIRECTFB)
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("DirectFB")));
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("DirectFB; ")));
#else
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Unknown")));
DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Unknown; ")));
#endif

return uaPlatform;
@@ -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(), "; ", 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;
@@ -3682,14 +3682,15 @@ 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 %Platform% expands to the windowing system followed by "; " if it is not Windows (e.g. "X11; ").
\o %Security% expands to "N; " if SSL is disabled.
\o %Subplatform% expands to the operating system version (e.g. "Windows NT 6.1" or "Intel Mac OS X 10.5").
\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
@@ -3708,47 +3709,47 @@ QString QWebPage::userAgentForUrl(const QUrl&) const

// Platform
#ifdef Q_WS_MAC
"Macintosh"
"Macintosh; "
#elif defined Q_WS_QWS
"QtEmbedded"
"QtEmbedded; "
#elif defined Q_WS_WIN
"Windows"
// Nothing
#elif defined Q_WS_X11
"X11"
"X11; "
#elif defined Q_OS_SYMBIAN
"Symbian"
#else
"Unknown"
"Unknown; "
#endif
);

#if defined Q_OS_SYMBIAN
QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion();
switch (symbianVersion) {
case QSysInfo::SV_9_2:
firstPartTemp += QString::fromLatin1("OS/9.2");
firstPartTemp += QString::fromLatin1("OS/9.2; ");
break;
case QSysInfo::SV_9_3:
firstPartTemp += QString::fromLatin1("OS/9.3");
firstPartTemp += QString::fromLatin1("OS/9.3; ");
break;
case QSysInfo::SV_9_4:
firstPartTemp += QString::fromLatin1("OS/9.4");
firstPartTemp += QString::fromLatin1("OS/9.4; ");
break;
case QSysInfo::SV_SF_2:
firstPartTemp += QString::fromLatin1("/2");
firstPartTemp += QString::fromLatin1("/2; ");
break;
case QSysInfo::SV_SF_3:
firstPartTemp += QString::fromLatin1("/3");
firstPartTemp += QString::fromLatin1("/3; ");
break;
case QSysInfo::SV_SF_4:
firstPartTemp += QString::fromLatin1("/4");
firstPartTemp += QString::fromLatin1("/4; ");
break;
default:
firstPartTemp += QString::fromLatin1("; ");
break;
}
#endif

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

#if defined(QT_NO_OPENSSL)
// No SSL support
firstPartTemp += QString::fromLatin1("N; ");
@@ -1,3 +1,13 @@
2011-03-03 Peter Kasting <pkasting@google.com>

Reviewed by James Robinson.

Drop redundant "Windows; " from the Windows-specific User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54567

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

2011-03-01 Brian Weinstein <bweinstein@apple.com>

Reviewed by Adam Roben.
@@ -1,3 +1,13 @@
2011-03-03 Peter Kasting <pkasting@google.com>

Reviewed by James Robinson.

Drop redundant "Windows; " from the Windows-specific User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54567

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

2011-03-01 Brian Weinstein <bweinstein@apple.com>

Reviewed by Adam Roben.
@@ -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; ", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Windows; ", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko) ", applicationName);
return makeString("Mozilla/5.0 (", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko) ", applicationName);
}

Page* WebView::page()
@@ -1,3 +1,13 @@
2011-03-03 Peter Kasting <pkasting@google.com>

Reviewed by James Robinson.

Drop redundant "Windows; " from the Windows-specific User Agent string.
https://bugs.webkit.org/show_bug.cgi?id=54567

* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::standardUserAgent):

2011-03-02 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r80188.
@@ -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; ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (Windows; ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
}

} // namespace WebKit

0 comments on commit 6e5a90b

Please sign in to comment.