prefer favicon.png over favicon.ico

This commit is contained in:
Mitchell Livingston 2010-04-13 00:20:19 +00:00
parent 39515ea28b
commit 0fa3285a88
1 changed files with 4 additions and 4 deletions

View File

@ -224,18 +224,18 @@ NSMutableSet * fTrackerIconLoading;
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
//try favicon.ico
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
//try favicon.png
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
NSURLRequest * request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
timeoutInterval: 30.0];
NSData * iconData = [NSURLConnection sendSynchronousRequest: request returningResponse: NULL error: NULL];
NSImage * icon = [[NSImage alloc] initWithData: iconData];
//try favicon.png
//try favicon.ico
if (!icon)
{
favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
timeoutInterval: 30.0];