WebKit/mac:
authorsfalken@apple.com <sfalken@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2009 03:23:44 +0000 (03:23 +0000)
committersfalken@apple.com <sfalken@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2009 03:23:44 +0000 (03:23 +0000)
2009-05-18  Sam Weinig  <sam@webkit.org>

        <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent

        Add user agent hack for pointroll.com.

        Reviewed by Steve Falkenburg.

        * WebView/WebView.mm:
        (-[WebView WebCore::_userAgentForURL:WebCore::]):

WebKit/win:

2009-05-18  Steve Falkenburg  <sfalken@apple.com>

        <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent

        Add user agent hack for pointroll.com.

        Reviewed by Sam Weinig.

        * WebView.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43848 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/WebView/WebView.mm
WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index b1038ed079576c93b0097f36b9714e1b28a6964e..c44970c0624f8f9e549e79ceebf2bb409d94f65e 100644 (file)
@@ -1,3 +1,14 @@
+2009-05-18  Sam Weinig  <sam@webkit.org>
+
+        <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent
+        
+        Add user agent hack for pointroll.com.
+
+        Reviewed by Steve Falkenburg.
+
+        * WebView/WebView.mm:
+        (-[WebView WebCore::_userAgentForURL:WebCore::]):
+
 2009-05-16  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig and Dan Bernstein.
index 4f9d693349c48ba5bbcbae538dcb1267fd31e1a9..05fce4a661766f4913783c2f0937be374ac53cb6 100644 (file)
@@ -5271,7 +5271,11 @@ static WebFrameView *containingFrameView(NSView *view)
 - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url
 {
     if (_private->useSiteSpecificSpoofing) {
-        // No current site-specific spoofs.
+        if (url.host() == "ads.pointroll.com") {
+            // <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent
+            DEFINE_STATIC_LOCAL(const String, uaForAdsPointroll, ("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.28.3"));
+            return uaForAdsPointroll;
+        }
     }
 
     if (_private->userAgent.isNull())
index 4f8ed9a79e3c43e915f1ce899ec4b0f10f83426b..3ee3b2356272ecb916170d6d6455d23247abfde9 100644 (file)
@@ -1,3 +1,13 @@
+2009-05-18  Steve Falkenburg  <sfalken@apple.com>
+
+        <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent
+        
+        Add user agent hack for pointroll.com.
+        
+        Reviewed by Sam Weinig.
+
+        * WebView.cpp:
+
 2009-05-13  Dmitry Titov  <dimich@chromium.org>
 
         Rubber-stamped by Mark Rowe.
index b032d8edc3c21d4ca65e2437e531f892e0cfe67e..de8a43dd9864296d78a55cf7330209d05c276634 100644 (file)
@@ -2011,11 +2011,19 @@ exit:
     return versionStr;
 }
 
-const String& WebView::userAgentForKURL(const KURL&)
+const String& WebView::userAgentForKURL(const KURL& url)
 {
     if (m_userAgentOverridden)
         return m_userAgentCustom;
 
+    if (allowSiteSpecificHacks()) {
+        if (url.host() == "ads.pointroll.com") {
+            // <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent
+            DEFINE_STATIC_LOCAL(const String, uaForAdsPointroll, ("Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.29"));
+            return uaForAdsPointroll;
+        }
+    }
+
     if (!m_userAgentStandard.length())
         m_userAgentStandard = WebView::standardUserAgentWithApplicationName(m_applicationName);
     return m_userAgentStandard;