mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
swift format
This commit is contained in:
parent
c6be0b31c1
commit
a8b454a50e
@ -13,7 +13,7 @@ class SafariExtensionHandler: SFSafariExtensionHandler {
|
||||
super.init()
|
||||
SafariExtensionViewController.shared.initWebView()
|
||||
}
|
||||
|
||||
|
||||
override func messageReceived(withName messageName: String, from page: SFSafariPage, userInfo: [String: Any]?) {
|
||||
// This method will be called when a content script provided by your extension calls safari.extension.dispatchMessage("message").
|
||||
if messageName == "bitwarden" {
|
||||
@ -48,11 +48,11 @@ class SafariExtensionHandler: SFSafariExtensionHandler {
|
||||
self.sendMessage(msg: ["command": "reloadPopup"], sender: nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override func popoverDidClose(in _: SFSafariWindow) {
|
||||
SafariExtensionViewController.shared.popoverOpenCount -= 1
|
||||
}
|
||||
|
||||
|
||||
func sendMessage(msg: [String: Any]?, sender: Tab? = nil) {
|
||||
if SafariExtensionViewController.shared.webView == nil {
|
||||
return
|
||||
|
@ -151,7 +151,7 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
||||
})
|
||||
}
|
||||
} else if command == "isPopoverOpen" {
|
||||
m!.responseData = popoverOpenCount > 0 ? "true" : "false";
|
||||
m!.responseData = popoverOpenCount > 0 ? "true" : "false"
|
||||
replyMessage(message: m!)
|
||||
} else if command == "createNewTab" {
|
||||
if m!.data != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user