Skip to content

Commit

Permalink
Open YouTube page via WebKit rather than NSWorkspace.
Browse files Browse the repository at this point in the history
No idea whether this is the _right_ thing to do but it certainly improves the behaviour in applications like NewsFire or BibDesk.

»Philosophically« the issue seems to be that going through NSWorkspace will send an AppleEvent to open the URL. If the application doesn't support the open URL AppleEvent, things start behaving strangely.

A further question would be whether it’d be preferable to open the YouTube.com page in a new window instead of opening it in the current one.
  • Loading branch information
ssp committed Jul 26, 2009
1 parent 13b1e67 commit 26de0f0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -1354,11 +1354,7 @@ - (IBAction)loadYouTubePage:(id)sender
{
NSString* YouTubePageURL = [ NSString stringWithFormat: @"http://www.youtube.com/watch?v=%@", [self videoId] ];

[[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObject:[NSURL URLWithString:YouTubePageURL]]
withAppBundleIdentifier:[self launchedAppBundleIdentifier]
options:NSWorkspaceLaunchDefault
additionalEventParamDescriptor:[NSAppleEventDescriptor nullDescriptor]
launchIdentifiers:nil];
[_webView setMainFrameURL:YouTubePageURL];
}

- (IBAction)openFullscreenInQTPlayer:(id)sender;
Expand Down

0 comments on commit 26de0f0

Please sign in to comment.