Adds reader mode shortcut (cmd+shift+R)

This commit is contained in:
James Magahern
2022-08-22 17:18:50 -07:00
parent 184396b1d8
commit 957ee045b4
4 changed files with 57 additions and 28 deletions

View File

@@ -47,6 +47,9 @@ protocol ShortcutResponder: AnyObject {
@objc
optional func toggleDarkMode(_ sender: Any?)
@objc
optional func openInReaderMode(_ sender: Any?)
}
fileprivate extension Array {
@@ -88,6 +91,13 @@ public class KeyboardShortcuts {
action: #selector(ShortcutResponder.focusURLBar)
),
// Open in Reader
UIKeyCommand(
modifiers: [ .command, .shift ], input: "R",
title: "Open in Reader Mode…",
action: #selector(ShortcutResponder.openInReaderMode)
),
// Tabs
UIMenu(options: .displayInline, children: [
// Create Tab