mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 22:52:26 +00:00
changed open mechanics to use 10.10 APIs to try to fix 10.13 launch bugs with chrome
This commit is contained in:
@@ -714,15 +714,17 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
webURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@", [expandedURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
webURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@", [expandedURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *browserBundleID = [[NSUserDefaults standardUserDefaults] objectForKey:kMPSettingsKeyBrowserBundleId];
|
NSString *browserBundleID = [NSUserDefaults.standardUserDefaults stringForKey:kMPSettingsKeyBrowserBundleId];
|
||||||
|
NSURL *browserApplicationURL = browserBundleID ? [NSWorkspace.sharedWorkspace URLForApplicationWithBundleIdentifier:browserBundleID] : nil;
|
||||||
BOOL openedURL = NO;
|
BOOL openedURL = NO;
|
||||||
|
|
||||||
if(browserBundleID) {
|
if(browserApplicationURL) {
|
||||||
openedURL = [[NSWorkspace sharedWorkspace] openURLs:@[webURL] withAppBundleIdentifier:browserBundleID options:NSWorkspaceLaunchAsync additionalEventParamDescriptor:nil launchIdentifiers:NULL];
|
NSRunningApplication *urlOpeningApplication = [NSWorkspace.sharedWorkspace openURLs:@[webURL] withApplicationAtURL:browserApplicationURL options:NSWorkspaceLaunchDefault configuration:@{} error:nil];
|
||||||
|
openedURL = nil != urlOpeningApplication;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!openedURL) {
|
if(!openedURL) {
|
||||||
openedURL = [[NSWorkspace sharedWorkspace] openURL:webURL];
|
openedURL = [NSWorkspace.sharedWorkspace openURL:webURL];
|
||||||
}
|
}
|
||||||
if(!openedURL) {
|
if(!openedURL) {
|
||||||
NSLog(@"Unable to open URL %@", webURL);
|
NSLog(@"Unable to open URL %@", webURL);
|
||||||
|
|||||||
Reference in New Issue
Block a user