Finished implenting custom browser support

With this change, another localized string for OTHER_BROWSER will be
needed as well.

I've also set the project to use 2 spaces for tabs by default since that
is the coding style you use in the project.
This commit is contained in:
James Hurst
2014-08-16 14:34:26 -04:00
parent be03656ce9
commit 8c1e6733e8
5 changed files with 62 additions and 12 deletions

View File

@@ -621,9 +621,17 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
if(!scheme) {
webURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@", [selectedEntry.url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
}
[[NSWorkspace sharedWorkspace] openURL:webURL];
/* Add custom browser support */
//[[NSWorkspace sharedWorkspace] openURLs:@[webURL] withAppBundleIdentifier:@"org.mozilla.firefox" options:NSWorkspaceLaunchAsync additionalEventParamDescriptor:nil launchIdentifiers:NULL];
NSString *browserBundleID = [[NSUserDefaults standardUserDefaults] objectForKey:kMPSettingsKeyBrowserBundleId];
BOOL launched = NO;
if (browserBundleID) {
launched = [[NSWorkspace sharedWorkspace] openURLs:@[webURL] withAppBundleIdentifier:browserBundleID options:NSWorkspaceLaunchAsync additionalEventParamDescriptor:nil launchIdentifiers:NULL];
}
if (!launched) {
[[NSWorkspace sharedWorkspace] openURL:webURL];
}
}
}