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

no response for tab messages

This commit is contained in:
Kyle Spearrin 2019-08-19 12:28:18 -04:00
parent efbed1a9a3
commit 94805468bc

View File

@ -114,10 +114,7 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
}
winIndex = winIndex + 1
}
if theWin == nil {
m!.responseError = true
self.replyMessage(message: m!)
} else {
if theWin != nil {
var theTab: SFSafariTab?
theWin!.getAllTabs { tabs in
var tabIndex = 0
@ -128,17 +125,10 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
}
tabIndex = tabIndex + 1
}
if theTab == nil {
m!.responseError = true
self.replyMessage(message: m!)
} else {
if theTab != nil {
theTab!.getActivePage { activePage in
if activePage != nil {
activePage?.dispatchMessageToScript(withName: "bitwarden", userInfo: ["msg": tabMsg!.obj])
self.replyMessage(message: m!)
} else {
m!.responseError = true
self.replyMessage(message: m!)
}
}
}