[webkit-changes] cvs commit: WebKit/WebView.subproj WebView.m

Vicki vicki at opensource.apple.com
Mon Jul 25 17:11:34 PDT 2005


vicki       05/07/25 17:11:33

  Modified:    .        ChangeLog
               WebView.subproj WebView.m
  Log:
          Reviewed by Darin.
  
  	- fixed <rdar://problem/3470523> Safari's user agent should be changed to say Intel rather
  	than PPC on Intel machines
  
          * WebView.subproj/WebView.m: add conditional #defines for "PPC" and "Intel"
          (-[WebView userAgentForURL:]): use this variable when constructing the user agent string
  
  Revision  Changes    Path
  1.3257    +10 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3256
  retrieving revision 1.3257
  diff -u -r1.3256 -r1.3257
  --- ChangeLog	25 Jul 2005 00:35:29 -0000	1.3256
  +++ ChangeLog	26 Jul 2005 00:11:30 -0000	1.3257
  @@ -1,3 +1,13 @@
  +2005-07-25  Vicki Murley <vicki at apple.com>
  +
  +        Reviewed by Darin.
  + 
  +	- fixed <rdar://problem/3470523> Safari's user agent should be changed to say Intel rather 
  +	than PPC on Intel machines
  +
  +        * WebView.subproj/WebView.m: add conditional #defines for "PPC" and "Intel"
  +        (-[WebView userAgentForURL:]): use this variable when constructing the user agent string
  +
   2005-07-24  Justin Garcia  <justin.garcia at apple.com>
   
           Reviewed by mjs
  
  
  
  1.297     +11 -5     WebKit/WebView.subproj/WebView.m
  
  Index: WebView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebView.m,v
  retrieving revision 1.296
  retrieving revision 1.297
  diff -u -r1.296 -r1.297
  --- WebView.m	22 Jul 2005 21:52:11 -0000	1.296
  +++ WebView.m	26 Jul 2005 00:11:33 -0000	1.297
  @@ -87,6 +87,14 @@
   
   #import <Foundation/NSURLConnection.h>
   
  +#if __ppc__
  +#define PROCESSOR "PPC"
  +#elif __i386__
  +#define PROCESSOR "Intel"
  +#else
  +#error Unknown architecture
  +#endif
  +
   #define FOR_EACH_RESPONDER_SELECTOR(macro) \
   macro(alignCenter) \
   macro(alignJustified) \
  @@ -1925,7 +1933,7 @@
       return [[[self mainFrame] _bridge] windowScriptObject];
   }
   
  -
  +	
   // Get the appropriate user-agent string for a particular URL.
   // Since we no longer automatically spoof, this no longer requires looking at the URL.
   - (NSString *)userAgentForURL:(NSURL *)URL
  @@ -1935,18 +1943,16 @@
           return [[userAgent retain] autorelease];
       }
       
  -    // FIXME: Some day we will start reporting the actual CPU here instead of hardcoding PPC.
  -
       NSString *language = [NSUserDefaults _webkit_preferredLanguageCode];
       id sourceVersion = [[NSBundle bundleForClass:[WebView class]]
           objectForInfoDictionaryKey:(id)kCFBundleVersionKey];
       NSString *applicationName = _private->applicationNameForUserAgent;
   
       if ([applicationName length]) {
  -        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko) %@",
  +        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko) %@",
               language, sourceVersion, applicationName];
       } else {
  -        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko)",
  +        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko)",
               language, sourceVersion];
       }
   
  
  
  



More information about the webkit-changes mailing list