Skip to content

Commit

Permalink
Add yandexbrowser support
Browse files Browse the repository at this point in the history
  • Loading branch information
yury authored Feb 1, 2019
1 parent 3f7c198 commit 051bcd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion openurl.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

NSArray<NSString *> *__known_browsers() {
// TODO: @"opera" opera-http(s): doesn't work
// @"yandexbrowser"
return @[@"googlechrome", @"firefox", @"safari"];
}

Expand Down Expand Up @@ -51,6 +50,13 @@
return [NSURL URLWithString:url];
}

if ([browser isEqualToString:@"yandexbrowser"]) {
NSString *url = [absSrcURLStr
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
url = [@"yandexbrowser-open-url://" stringByAppendingString:url];
return [NSURL URLWithString:url];
}

NSString *browserAppUrlStr = [absSrcURLStr stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:browser];
return [NSURL URLWithString:browserAppUrlStr];
}
Expand Down

0 comments on commit 051bcd9

Please sign in to comment.