diff --git a/ClickToFlash.xcodeproj/project.pbxproj b/ClickToFlash.xcodeproj/project.pbxproj index b886a9e4..62725795 100755 --- a/ClickToFlash.xcodeproj/project.pbxproj +++ b/ClickToFlash.xcodeproj/project.pbxproj @@ -53,7 +53,6 @@ 845704550F4792320017F3F4 /* CTFWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 845704540F4792320017F3F4 /* CTFWhitelist.m */; }; 8457045A0F47BC170017F3F4 /* CTFUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 845704590F47BC170017F3F4 /* CTFUtilities.m */; }; A494CC2C0F9F2446007D5EEB /* ctf.icns in Resources */ = {isa = PBXBuildFile; fileRef = A494CC2B0F9F2446007D5EEB /* ctf.icns */; }; - A4CB766F0FFB041500CC819F /* CTFURLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = A4CB766D0FFB041500CC819F /* CTFURLConnection.m */; }; A4DEFC7A0FF33F7400CCB6A8 /* CTFPreferencesDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = A4DEFC770FF33F7400CCB6A8 /* CTFPreferencesDictionary.m */; }; A4DEFC7B0FF33F7400CCB6A8 /* CTFUserDefaultsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A4DEFC790FF33F7400CCB6A8 /* CTFUserDefaultsController.m */; }; D9566D8C0F380C9F00358646 /* sifr2-addons.js in Resources */ = {isa = PBXBuildFile; fileRef = D9566C2C0F37EA0800358646 /* sifr2-addons.js */; }; @@ -157,8 +156,6 @@ 845704580F47BC170017F3F4 /* CTFUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFUtilities.h; path = Plugin/CTFUtilities.h; sourceTree = ""; }; 845704590F47BC170017F3F4 /* CTFUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFUtilities.m; path = Plugin/CTFUtilities.m; sourceTree = ""; }; A494CC2B0F9F2446007D5EEB /* ctf.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = ctf.icns; path = Plugin/ctf.icns; sourceTree = ""; }; - A4CB766D0FFB041500CC819F /* CTFURLConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFURLConnection.m; path = Plugin/CTFURLConnection.m; sourceTree = ""; }; - A4CB766E0FFB041500CC819F /* CTFURLConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFURLConnection.h; path = Plugin/CTFURLConnection.h; sourceTree = ""; }; A4DEFC760FF33F7400CCB6A8 /* CTFPreferencesDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFPreferencesDictionary.h; path = Plugin/CTFPreferencesDictionary.h; sourceTree = ""; }; A4DEFC770FF33F7400CCB6A8 /* CTFPreferencesDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTFPreferencesDictionary.m; path = Plugin/CTFPreferencesDictionary.m; sourceTree = ""; }; A4DEFC780FF33F7400CCB6A8 /* CTFUserDefaultsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTFUserDefaultsController.h; path = Plugin/CTFUserDefaultsController.h; sourceTree = ""; }; @@ -209,8 +206,6 @@ A4DEFC760FF33F7400CCB6A8 /* CTFPreferencesDictionary.h */, A4DEFC790FF33F7400CCB6A8 /* CTFUserDefaultsController.m */, A4DEFC780FF33F7400CCB6A8 /* CTFUserDefaultsController.h */, - A4CB766D0FFB041500CC819F /* CTFURLConnection.m */, - A4CB766E0FFB041500CC819F /* CTFURLConnection.h */, 845704590F47BC170017F3F4 /* CTFUtilities.m */, 845704580F47BC170017F3F4 /* CTFUtilities.h */, 6953E4340F3EDE9D0014ECF7 /* CTFMenubarMenuController.m */, @@ -424,7 +419,6 @@ A4DEFC7A0FF33F7400CCB6A8 /* CTFPreferencesDictionary.m in Sources */, A4DEFC7B0FF33F7400CCB6A8 /* CTFUserDefaultsController.m in Sources */, 79166CBD0FF69E1800B1F69B /* CTGradient.m in Sources */, - A4CB766F0FFB041500CC819F /* CTFURLConnection.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -494,6 +488,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_SIGN_COMPARE = YES; @@ -506,6 +501,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_SIGN_COMPARE = YES; diff --git a/Plugin/CTFURLConnection.h b/Plugin/CTFURLConnection.h deleted file mode 100755 index 199b980c..00000000 --- a/Plugin/CTFURLConnection.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// CTFURLConnection.h -// ClickToFlash -// -// Created by Simone Manganelli on 2009-06-30. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import - - -@interface CTFURLConnection : NSObject { - NSConditionLock *theLock; - NSHTTPURLResponse *responseToReturn; - NSError *errorToReturn; -} - -- (NSHTTPURLResponse *)getURLResponseHeaders:(NSURL *)URL - error:(NSError **)error; -+ (NSHTTPURLResponse *)getURLResponseHeaders:(NSURL *)URL - error:(NSError **)error; - -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error; -- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)theResponse; -- (void)connectionDidFinishLoading:(NSURLConnection *)connection; - -@end diff --git a/Plugin/CTFURLConnection.m b/Plugin/CTFURLConnection.m deleted file mode 100644 index 66562c4a..00000000 --- a/Plugin/CTFURLConnection.m +++ /dev/null @@ -1,106 +0,0 @@ -// -// CTFURLConnection.m -// ClickToFlash -// -// Created by Simone Manganelli on 2009-06-30. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "CTFURLConnection.h" - - -@implementation CTFURLConnection - - -- (NSHTTPURLResponse *)getURLResponseHeaders:(NSURL *)URL - error:(NSError **)error; -{ - theLock = [[NSConditionLock alloc] initWithCondition:0]; - - NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL]; - [request setHTTPMethod:@"HEAD"]; - - - // this header is required, because otherwise the URLRequest will download - // the whole video before returning, which completely defeats the purpose - // of checking for the video variants in the first place - - // this limits the download to the first 2 bytes of the video, which is - // sufficient to see if there is a video there or not. - - // since the Range header is not always honored, we also stop getting data - // from the NSURLConnection by stopping it once we get the NSURLResponse - [request setValue:@"bytes=0-1" forHTTPHeaderField:@"Range"]; - - [NSThread detachNewThreadSelector:@selector(startRequest:) toTarget:self withObject:request]; - [request release]; - - [theLock lockWhenCondition:1]; - [theLock unlock]; - if (error) (*error) = errorToReturn; - - - return [responseToReturn autorelease]; -} - -+ (NSHTTPURLResponse *)getURLResponseHeaders:(NSURL *)URL - error:(NSError **)error; -{ - CTFURLConnection *theConnection = [[CTFURLConnection alloc] init]; - NSHTTPURLResponse *theResponse = [theConnection getURLResponseHeaders:URL - error:error]; - [theConnection autorelease]; - return theResponse; -} - -- (void)startRequest:(NSURLRequest *)request; -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request - delegate:self - startImmediately:YES]; - - NSRunLoop *rl = [NSRunLoop currentRunLoop]; - - while ([rl runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) { - if ([theLock tryLockWhenCondition:1]) { - [theLock unlock]; - break; - } - } - - [connection release]; - - [pool drain]; -} - -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error; -{ - [theLock lock]; - - errorToReturn = error; - [theLock unlockWithCondition:1]; -} - -- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)theResponse; -{ - [theLock lock]; - - // we cancel here, because otherwise NSURLConnection will continue to download - // data due to a bug; even though we made a HEAD request, it still downloads - // all the data at the given URL instead of stopping after receiving headers - [connection cancel]; - responseToReturn = [theResponse retain]; - [theLock unlockWithCondition:1]; - -} - -- (void)connectionDidFinishLoading:(NSURLConnection *)connection; -{ - [theLock lock]; - - [theLock unlockWithCondition:1]; -} - -@end diff --git a/Plugin/English.lproj/WhitelistPanel.xib b/Plugin/English.lproj/WhitelistPanel.xib index 92bb4e6f..c06e4289 100755 --- a/Plugin/English.lproj/WhitelistPanel.xib +++ b/Plugin/English.lproj/WhitelistPanel.xib @@ -1,23 +1,27 @@ - + 1040 - 9J61 - 677 - 949.46 - 353.00 + 10A394 + 732 + 1027.1 + 430.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + YES - + + YES - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin YES - + YES @@ -40,10 +44,10 @@ 2 {{80, 187}, {527, 516}} -534248448 - Q2xpY2tUb0ZsYXNoIOKAlCBTZXR0aW5ncw + ClickToFlash — Settings NSPanel - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {420, 400} @@ -82,16 +86,16 @@ YES - 4.820000e+02 - 4.000000e+01 - 2.000000e+03 + 482 + 40 + 2000 - 75628032 - 134217728 + 75628096 + 134219776 Whitelisted Sites LucidaGrande - 1.100000e+01 + 11 3100 @@ -114,7 +118,7 @@ Text Cell LucidaGrande - 1.100000e+01 + 11 16 @@ -124,7 +128,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -140,8 +144,8 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -152,13 +156,16 @@ MC41AA - 1.700000e+01 + 17 1119879168 + + 2 4 15 0 YES + 0 {{1, 17}, {485, 151}} @@ -175,18 +182,18 @@ _doScroller: - 3.700000e+01 - 1.947368e-01 + 37 + 0.19473679999999999 - 256 + -2147483392 {{-100, -100}, {450, 15}} 1 _doScroller: - 9.976415e-01 + 0.99764149999999996 @@ -224,15 +231,15 @@ 67239424 134348800 - 4oiSA + Courier - 1.400000e+01 + 14 16 -2038284033 - 162 + 34 200 @@ -252,7 +259,7 @@ -2038284033 - 162 + 34 200 @@ -297,12 +304,12 @@ Load H.264 videos from YouTube LucidaGrande - 1.300000e+01 + 13 1044 1211912703 - 130 + 2 NSImage NSSwitch @@ -329,7 +336,7 @@ 1211912703 - 130 + 2 @@ -351,7 +358,7 @@ 1211912703 - 130 + 2 @@ -393,7 +400,7 @@ 1211912703 - 128 + 0 NSRadioButton @@ -407,10 +414,10 @@ 0 Always load (provides better typography) - 1 + 1 1211912703 - 128 + 0 549453824 {18, 18} @@ -418,7 +425,7 @@ YES YES - + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA @@ -444,10 +451,10 @@ AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES -AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABBxwAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAwYAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAMGGFw cGwCAAAAbW50clJHQiBYWVogB9YABAADABMALAASYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAPbWAAEAAAAA0y1hcHBs2U706y3Sst1fqit5+wYbUQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAPbWAAEAAAAA0y1hcHBsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAOclhZWgAAASwAAAAUZ1hZWgAAAUAAAAAUYlhZWgAAAVQAAAAUd3RwdAAAAWgAAAAUY2hhZAAA AXwAAAAsclRSQwAAAagAAAAOZ1RSQwAAAbgAAAAOYlRSQwAAAcgAAAAOdmNndAAAAdgAAAMSbmRpbgAA BOwAAAY+ZGVzYwAACywAAABkZHNjbQAAC5AAAAAubW1vZAAAC8AAAAAoY3BydAAAC+gAAAAtWFlaIAAA @@ -516,10 +523,10 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 0 Suppress replacement (uses HTML text) - 2 + 2 1211912703 - 128 + 0 549453824 {18, 18} @@ -527,7 +534,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA YES YES - + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA @@ -553,7 +560,7 @@ AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES -AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABBxwAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAPcAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAD3GFw cGwCAAAAbW50clJHQiBYWVogB9kAAQAHAAIADAAeYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAPbWAAEAAAAA0y1hcHBsCh6zG+heDkCDNUtZfpGylwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA @@ -593,7 +600,7 @@ Z2h0IEFwcGxlLCBJbmMuLCAyMDA5AA Radio 1211912703 - 128 + 0 549453824 {18, 18} @@ -601,7 +608,7 @@ Z2h0IEFwcGxlLCBJbmMuLCAyMDA5AA YES YES - + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA @@ -627,7 +634,7 @@ AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES -AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABBxwAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA @@ -708,7 +715,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 1211912703 - 130 + 2 @@ -730,7 +737,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA -2038284033 - 129 + 1 200 @@ -750,7 +757,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 1211912703 - 130 + 2 @@ -772,7 +779,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA -2038284033 - 129 + 1 200 @@ -806,7 +813,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{0, 0}, {1280, 778}} {420, 422} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} ClickToFlash_settingsWindow @@ -847,7 +854,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 107} @@ -870,7 +877,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 1 Helvetica - 1.300000e+01 + 13 16 @@ -909,7 +916,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 YES - + YES Apple PDF pasteboard type Apple PICT pasteboard type @@ -948,7 +955,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Are you sure you want to uninstall ClickToFlash? LucidaGrande-Bold - 1.300000e+01 + 13 2072 @@ -977,7 +984,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{0, 0}, {1280, 778}} {213, 129} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} 1 @@ -989,7 +996,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 107} @@ -1026,7 +1033,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 YES - + YES Apple PDF pasteboard type Apple PICT pasteboard type @@ -1075,9 +1082,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 67239424 4194304 - Q2xpY2tUb0ZsYXNoIG1heSBiZSBpbnN0YWxsZWQgZm9yIGFsbCB1c2Vycy4gIE1hbnVhbGx5IGRlbGV0 -ZSAiQ2xpY2tUb0ZsYXNoLndlYnBsdWdpbiIgZnJvbSAvTGlicmFyeS9JbnRlcm5ldCBQbHVnLWlucy8g -dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 + ClickToFlash may be installed for all users. Manually delete "ClickToFlash.webplugin" from /Library/Internet Plug-ins/ to uninstall ClickToFlash. @@ -1089,7 +1094,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 {{0, 0}, {1280, 778}} {213, 129} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} 1 @@ -1101,10 +1106,10 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 107} - + 256 YES @@ -1138,7 +1143,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 256 YES - + YES Apple PDF pasteboard type Apple PICT pasteboard type @@ -1181,7 +1186,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 256 - {{109, 34}, {335, 42}} + {{109, 48}, {310, 28}} YES @@ -1196,10 +1201,11 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 {461, 124} + {{0, 0}, {1280, 778}} {213, 129} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} @@ -1274,7 +1280,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 versionString NSAllowsEditingMultipleValuesSelection - + 2 @@ -1358,7 +1364,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 values.siteInfo NSHandlesContentAsCompoundValue - + 2 @@ -1474,14 +1480,14 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 arrangedObjects.site YES - + YES NSAllowsEditingMultipleValuesSelection NSNullPlaceholder YES - + double-click to set @@ -1512,28 +1518,26 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -1543,7 +1547,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - + 2 @@ -1562,7 +1566,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 4 - + Whitelisted Hosts @@ -1838,7 +1842,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 170 - + Plugin Defaults @@ -1876,7 +1880,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - + Uninstall Confirm @@ -1969,7 +1973,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - + Uninstall Failure @@ -2047,7 +2051,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - + Uninstall Success @@ -2136,12 +2140,11 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 1.IBEditorWindowLastContentRect + 1.IBPluginDependency 1.IBViewEditorWindowController.showingLayoutRectangles 1.IBWindowTemplateEditedContentRect 1.NSWindowTemplate.visibleAtLaunch @@ -2189,6 +2192,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 190.IBPluginDependency 191.IBPluginDependency 194.IBEditorWindowLastContentRect + 194.IBPluginDependency 194.IBViewEditorWindowController.showingLayoutRectangles 194.IBWindowTemplateEditedContentRect 194.ImportedFromIB2 @@ -2215,6 +2219,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 207.IBPluginDependency 21.IBPluginDependency 213.IBEditorWindowLastContentRect + 213.IBPluginDependency 213.IBViewEditorWindowController.showingLayoutRectangles 213.IBWindowTemplateEditedContentRect 213.ImportedFromIB2 @@ -2235,6 +2240,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 222.IBPluginDependency 223.IBPluginDependency 225.IBEditorWindowLastContentRect + 225.IBPluginDependency 225.IBViewEditorWindowController.showingLayoutRectangles 225.IBWindowTemplateEditedContentRect 225.ImportedFromIB2 @@ -2271,15 +2277,14 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit {{240, 125}, {527, 516}} - + com.apple.InterfaceBuilder.CocoaPlugin + {{240, 125}, {527, 516}} - + {196, 240} {{202, 428}, {480, 270}} - + {420, 400} com.apple.InterfaceBuilder.CocoaPlugin @@ -2363,25 +2368,26 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{97, 461}, {461, 124}} - + com.apple.InterfaceBuilder.CocoaPlugin + {{97, 461}, {461, 124}} - - + + {213, 107} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2389,41 +2395,43 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{105, 287}, {461, 150}} - + com.apple.InterfaceBuilder.CocoaPlugin + {{105, 287}, {461, 150}} - - + + {213, 107} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{132, 289}, {461, 124}} - + com.apple.InterfaceBuilder.CocoaPlugin + {{132, 289}, {461, 124}} - - + + {213, 107} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2459,9 +2467,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - - YES - + YES @@ -2469,9 +2475,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - - YES - + YES @@ -2495,7 +2499,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 NSWindowController YES - + YES approveUninstall: cancelUninstall: @@ -2516,7 +2520,7 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 YES - + YES _checkNowButton _controller @@ -2539,8 +2543,94 @@ dG8gdW5pbnN0YWxsIENsaWNrVG9GbGFzaC4 + + YES + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES ../../ClickToFlash.xcodeproj 3 diff --git a/Plugin/Plugin.h b/Plugin/Plugin.h index 849df271..610dbf78 100755 --- a/Plugin/Plugin.h +++ b/Plugin/Plugin.h @@ -52,8 +52,10 @@ THE SOFTWARE. NSString *_src; NSString *_videoId; NSString *_launchedAppBundleIdentifier; - + BOOL _contextMenuIsVisible; + NSURLConnection *connections[2]; + unsigned expectedResponses; } + (NSView *)plugInViewWithArguments:(NSDictionary *)arguments; diff --git a/Plugin/Plugin.m b/Plugin/Plugin.m index 18d1e34a..a6f5c1e9 100755 --- a/Plugin/Plugin.m +++ b/Plugin/Plugin.m @@ -27,7 +27,6 @@ of this software and associated documentation files (the "Software"), to deal #import "Plugin.h" #import "CTFUserDefaultsController.h" #import "CTFPreferencesDictionary.h" -#import "CTFURLConnection.h" #import "MATrackingArea.h" #import "CTFMenubarMenuController.h" @@ -191,9 +190,7 @@ - (id) initWithArguments:(NSDictionary *)arguments // this retrieves new data from the internets, so it should // spawn a new thread - [NSThread detachNewThreadSelector:@selector(_checkForH264VideoVariants) - toTarget:self - withObject:nil]; + [self _checkForH264VideoVariants]; } else { // it's an embedded YouTube flash view; scrub the URL to // determine the video_id, then get the source of the YouTube @@ -403,6 +400,11 @@ - (void)webPlugInDestroy _badgeText = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; + + for (int i = 0; i < 2; ++i) { + [connections[i] release]; + connections[i] = nil; + } } - (void) dealloc @@ -1088,54 +1090,67 @@ - (NSString*) _videoHash return [ self flashvarWithName: @"t" ]; } -- (void) _checkForH264VideoVariants +- (void)_checkForH264VideoVariants { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString* video_id = [self videoId]; - NSString* video_hash = [ self _videoHash ]; + NSString *video_id = [self videoId]; + NSString *video_hash = [self _videoHash]; if (video_id && video_hash) { - - NSString* src = [ NSString stringWithFormat: @"http://www.youtube.com/get_video?fmt=18&video_id=%@&t=%@", - video_id, video_hash ]; - NSString* HDSrc = [ NSString stringWithFormat: @"http://www.youtube.com/get_video?fmt=22&video_id=%@&t=%@", - video_id, video_hash ]; - - NSError *error = nil; - CTFURLConnection *theConnection = [[CTFURLConnection alloc] init]; - NSHTTPURLResponse *H264Response = [theConnection getURLResponseHeaders:[NSURL URLWithString:src] - error:&error]; - [theConnection release]; - - int statusCode = [H264Response statusCode]; - - // 206 status code means partial content has been delivered, because of the - // range header, 200 means the request was OK - if ( ((statusCode == 206) || (statusCode == 200)) && (! error) ) { - [self _setHasH264Version:YES]; + // The standard H264 stream is format 18. HD is 22 + unsigned formats[] = { 18, 22 }; + + for (int i = 0; i < 2; ++i) { + NSMutableURLRequest *request; + + request = [NSMutableURLRequest requestWithURL: + [NSURL URLWithString: + [NSString stringWithFormat: + @"http://www.youtube.com/get_video?fmt=%u&video_id=%@&t=%@", + formats[i], video_id, video_hash]]]; + + connections[i] = [[NSURLConnection alloc] initWithRequest:request + delegate:self]; } - - CTFURLConnection *connectionTwo = [[CTFURLConnection alloc] init]; - NSHTTPURLResponse *HDH264Response = [connectionTwo getURLResponseHeaders:[NSURL URLWithString:HDSrc] - error:&error]; - [connectionTwo release]; - - statusCode = [HDH264Response statusCode]; - if ( ((statusCode == 206) || (statusCode == 200)) && (! error) ) { + + expectedResponses = 2; + } +} + +- (void)finishedWithConnection:(NSURLConnection *)connection +{ + BOOL receivedAllResponses = YES; + + for (int i = 0; i < 2; ++i) { + if (connection == connections[i]) { + [connection release]; + connections[i] = nil; + } else if (connections[i]) + receivedAllResponses = NO; + } + + if (receivedAllResponses) + [self setUpExtraMenuItems]; +} + +- (void)connection:(NSURLConnection *)connection +didReceiveResponse:(NSHTTPURLResponse *)response +{ + int statusCode = [response statusCode]; + + if (statusCode == 200) { + if (connection == connections[0]) + [self _setHasH264Version:YES]; + else [self _setHasHDH264Version:YES]; - } - - // this is here because the user may have already opened the contextual - // menu before the H.264 variants were determined, so we need to - // make sure these features are made available to them - - [self performSelectorOnMainThread:@selector(setUpExtraMenuItems) - withObject:nil - waitUntilDone:NO]; } - [pool drain]; + [self finishedWithConnection:connection]; +} + +- (void)connection:(NSURLConnection *)connection + didFailWithError:(NSError *)error +{ + [self finishedWithConnection:connection]; } - (BOOL) _useHDH264Version