mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
no response for tab messages
This commit is contained in:
@@ -114,10 +114,7 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
|||||||
}
|
}
|
||||||
winIndex = winIndex + 1
|
winIndex = winIndex + 1
|
||||||
}
|
}
|
||||||
if theWin == nil {
|
if theWin != nil {
|
||||||
m!.responseError = true
|
|
||||||
self.replyMessage(message: m!)
|
|
||||||
} else {
|
|
||||||
var theTab: SFSafariTab?
|
var theTab: SFSafariTab?
|
||||||
theWin!.getAllTabs { tabs in
|
theWin!.getAllTabs { tabs in
|
||||||
var tabIndex = 0
|
var tabIndex = 0
|
||||||
@@ -128,17 +125,10 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
|||||||
}
|
}
|
||||||
tabIndex = tabIndex + 1
|
tabIndex = tabIndex + 1
|
||||||
}
|
}
|
||||||
if theTab == nil {
|
if theTab != nil {
|
||||||
m!.responseError = true
|
|
||||||
self.replyMessage(message: m!)
|
|
||||||
} else {
|
|
||||||
theTab!.getActivePage { activePage in
|
theTab!.getActivePage { activePage in
|
||||||
if activePage != nil {
|
if activePage != nil {
|
||||||
activePage?.dispatchMessageToScript(withName: "bitwarden", userInfo: ["msg": tabMsg!.obj])
|
activePage?.dispatchMessageToScript(withName: "bitwarden", userInfo: ["msg": tabMsg!.obj])
|
||||||
self.replyMessage(message: m!)
|
|
||||||
} else {
|
|
||||||
m!.responseError = true
|
|
||||||
self.replyMessage(message: m!)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user