1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-26 12:25:20 +01:00

open tab on create new tab message

This commit is contained in:
Kyle Spearrin 2019-08-20 15:23:05 -04:00
parent fc7bbed965
commit 78343d3e60

View File

@ -152,8 +152,13 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
m!.responseData = popoverOpenCount > 0 ? "true" : "false";
replyMessage(message: m!)
} else if command == "createNewTab" {
// TODO
replyMessage(message: m!)
if m!.data != nil {
SFSafariApplication.getActiveWindow { win in
win?.openTab(with: URL(string: m!.data!)!, makeActiveIfPossible: true, completionHandler: { _ in
// Tab opened
})
}
}
} else if command == "reloadExtension" {
webView?.reload()
replyMessage(message: m!)