From 94805468bc2275784927a4584e9195f836def55c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 19 Aug 2019 12:28:18 -0400 Subject: [PATCH] no response for tab messages --- .../safari/SafariExtensionViewController.swift | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/safari/app/desktop/safari/SafariExtensionViewController.swift b/src/safari/app/desktop/safari/SafariExtensionViewController.swift index cdfb9aa2b8..9f8cf0ece0 100644 --- a/src/safari/app/desktop/safari/SafariExtensionViewController.swift +++ b/src/safari/app/desktop/safari/SafariExtensionViewController.swift @@ -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!) } } }