Shortcuts: close tab keyboard shortcut
This commit is contained in:
@@ -597,6 +597,20 @@ class BrowserViewController: UIViewController, WKNavigationDelegate, WKUIDelegat
|
||||
}
|
||||
}
|
||||
|
||||
func closeTab(_ sender: Any?) {
|
||||
if tabController.tabs.count > 1 {
|
||||
tabController.closeTab(self.tab)
|
||||
} else {
|
||||
#if targetEnvironment(macCatalyst)
|
||||
if let originWindowScene = self.view.window?.windowScene {
|
||||
UIApplication.shared.requestSceneSessionDestruction(originWindowScene.session, options: nil) { error in
|
||||
print("Error when requesting scene destruction: " + error.localizedDescription)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
func findOnPage(_ sender: Any?) {
|
||||
browserView.setFindOnPageVisible(true, animated: true)
|
||||
findOnPageController.findOnPageView.textField.becomeFirstResponder()
|
||||
|
||||
Reference in New Issue
Block a user