mirror of
https://github.com/bitwarden/browser
synced 2024-12-25 09:32:06 +01:00
Merge pull request #1349 from bitwarden/fix/safar-completion-handler-nil
Added logging and completion handler for JS
This commit is contained in:
commit
5861a51d54
@ -96,7 +96,12 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
||||
let messagesUrl = bundleUrl.appendingPathComponent("app/_locales/\(language)/messages.json")
|
||||
do {
|
||||
let json = try String(contentsOf: messagesUrl, encoding: .utf8)
|
||||
webView.evaluateJavaScript("window.bitwardenLocaleStrings = \(json);", completionHandler: nil)
|
||||
webView.evaluateJavaScript("window.bitwardenLocaleStrings = \(json);", completionHandler: {(result, error) in
|
||||
guard let err = error else {
|
||||
return;
|
||||
}
|
||||
NSLog("evaluateJavaScript error : %@", err.localizedDescription);
|
||||
})
|
||||
} catch {
|
||||
NSLog("ERROR on getLocaleStrings, \(error)")
|
||||
}
|
||||
@ -236,7 +241,12 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
||||
return
|
||||
}
|
||||
let json = (jsonSerialize(obj: message) ?? "null")
|
||||
webView.evaluateJavaScript("window.bitwardenSafariAppMessageReceiver(\(json));", completionHandler: nil)
|
||||
webView.evaluateJavaScript("window.bitwardenSafariAppMessageReceiver(\(json));", completionHandler: {(result, error) in
|
||||
guard let err = error else {
|
||||
return;
|
||||
}
|
||||
NSLog("evaluateJavaScript error : %@", err.localizedDescription);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user