diff --git a/Shared/Resources/GlobalKeyboardShortcuts.plist b/Shared/Resources/GlobalKeyboardShortcuts.plist
index 4c6f3662c..4471354f7 100644
--- a/Shared/Resources/GlobalKeyboardShortcuts.plist
+++ b/Shared/Resources/GlobalKeyboardShortcuts.plist
@@ -106,11 +106,11 @@
title
- Open in Browser
+ Open in Safari
key
[return]
action
- openInBrowser:
+ openInSafari:
key
diff --git a/iOS/KeyboardManager.swift b/iOS/KeyboardManager.swift
index c463fcde2..bf0a4c465 100644
--- a/iOS/KeyboardManager.swift
+++ b/iOS/KeyboardManager.swift
@@ -177,6 +177,9 @@ private extension KeyboardManager {
let openInBrowserTitle = NSLocalizedString("Open In Browser", comment: "Open In Browser")
keys.append(KeyboardManager.createKeyCommand(title: openInBrowserTitle, action: "openInBrowser:", input: UIKeyCommand.inputRightArrow, modifiers: [.command]))
+ let openInSafariTitle = NSLocalizedString("Open In Safari", comment: "Open In Safari")
+ keys.append(KeyboardManager.createKeyCommand(title: openInSafariTitle, action: "openInSafari:", input: "\r", modifiers: []))
+
let toggleReadTitle = NSLocalizedString("Toggle Read Status", comment: "Toggle Read Status")
keys.append(KeyboardManager.createKeyCommand(title: toggleReadTitle, action: "toggleRead:", input: "u", modifiers: [.command, .shift]))
diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift
index accf4b67e..1ca161c31 100644
--- a/iOS/MasterFeed/MasterFeedViewController.swift
+++ b/iOS/MasterFeed/MasterFeedViewController.swift
@@ -420,6 +420,10 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
@objc func openInBrowser(_ sender: Any?) {
coordinator.showBrowserForCurrentFeed()
}
+
+ @objc func openInSafari(_ sender: Any?) {
+ coordinator.showSafariForCurrentFeed()
+ }
@objc override func delete(_ sender: Any?) {
if let indexPath = coordinator.currentFeedIndexPath {
diff --git a/iOS/RootSplitViewController.swift b/iOS/RootSplitViewController.swift
index 33bd740c1..1089dbe26 100644
--- a/iOS/RootSplitViewController.swift
+++ b/iOS/RootSplitViewController.swift
@@ -81,6 +81,10 @@ class RootSplitViewController: UISplitViewController {
@objc func openInBrowser(_ sender: Any?) {
coordinator.showBrowserForCurrentArticle()
}
+
+ @objc func openInSafari(_ sender: Any?) {
+ coordinator.showSafariForCurrentArticle()
+ }
@objc func articleSearch(_ sender: Any?) {
coordinator.showSearch()
diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift
index 64abb8d3d..93a73fd5c 100644
--- a/iOS/SceneCoordinator.swift
+++ b/iOS/SceneCoordinator.swift
@@ -12,6 +12,7 @@ import Account
import Articles
import RSCore
import RSTree
+import SafariServices
enum PanelMode {
case unset
@@ -1183,6 +1184,21 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
}
UIApplication.shared.open(url, options: [:])
}
+
+ func showSafariForCurrentFeed() {
+ if let ip = currentFeedIndexPath, let url = homePageURLForFeed(ip) {
+ let vc = SFSafariViewController(url: url)
+ rootSplitViewController.viewControllers.last?.present(vc, animated: true)
+ }
+ }
+
+ func showSafariForCurrentArticle() {
+ guard let preferredLink = currentArticle?.preferredLink, let url = URL(string: preferredLink) else {
+ return
+ }
+ let vc = SFSafariViewController(url: url)
+ rootSplitViewController.viewControllers.last?.present(vc, animated: true)
+ }
func navigateToFeeds() {
masterFeedViewController?.focus()