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

conditional code for macos 10.12+

This commit is contained in:
Kyle Spearrin 2019-10-17 09:04:10 -04:00
parent 1345980392
commit b9103f23ce

View File

@ -38,10 +38,14 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
}
func webView(_ webView: WKWebView, didFinish _: WKNavigation!) {
if #available(OSXApplicationExtension 10.12, *) {
NSAnimationContext.runAnimationGroup({ _ in
NSAnimationContext.current.duration = 0.35
webView.animator().alphaValue = 1.0
})
} else {
// Fallback on earlier versions
}
}
override func viewDidLoad() {
@ -215,6 +219,7 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
}
extension SafariExtensionViewController: WKUIDelegate {
@available(OSXApplicationExtension 10.12, *)
func webView(_: WKWebView, runOpenPanelWith _: WKOpenPanelParameters, initiatedByFrame _: WKFrameInfo,
completionHandler: @escaping ([URL]?) -> Void) {
let openPanel = NSOpenPanel()