From 26de0f0bd64fd259d96fa15bb43d3f9d87588ff5 Mon Sep 17 00:00:00 2001 From: ssp Date: Sun, 26 Jul 2009 13:29:39 +0200 Subject: [PATCH] Open YouTube page via WebKit rather than NSWorkspace. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Plugin/Plugin.m | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Plugin/Plugin.m b/Plugin/Plugin.m index b0ed6133..0b635248 100755 --- a/Plugin/Plugin.m +++ b/Plugin/Plugin.m @@ -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;