diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index c4e4803a83..6578be8d5a 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -161,8 +161,7 @@ export class BrowserApi { if (BrowserApi.isChromeApi) { return chrome.runtime.getManifest().version; } else if (BrowserApi.isSafariApi) { - // TODO - return null; + return (window as any).bitwardenApplicationVersion; } else { return null; } diff --git a/src/safari/app/desktop/safari/SafariExtensionViewController.swift b/src/safari/app/desktop/safari/SafariExtensionViewController.swift index 42701aedd1..64fca079a7 100644 --- a/src/safari/app/desktop/safari/SafariExtensionViewController.swift +++ b/src/safari/app/desktop/safari/SafariExtensionViewController.swift @@ -68,7 +68,10 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe } let command = m!.command // print(command) - if command == "storage_get" { + if command == "windowLoaded" { + let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + webView.evaluateJavaScript("window.bitwardenApplicationVersion = '\(version)';", completionHandler: nil) + } else if command == "storage_get" { let obj = UserDefaults.standard.string(forKey: m!.data!) m!.responseData = obj replyMessage(message: m!) diff --git a/src/safari/app/desktop/safari/app/popup/index.html b/src/safari/app/desktop/safari/app/popup/index.html index 3fc0a60ccb..498e1a6e57 100644 --- a/src/safari/app/desktop/safari/app/popup/index.html +++ b/src/safari/app/desktop/safari/app/popup/index.html @@ -1,23 +1,32 @@ -
- - -