mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-02 08:40:08 +01:00
get app version from url
This commit is contained in:
parent
8defddfdd1
commit
972fef9d50
@ -69,11 +69,7 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
||||
}
|
||||
let command = m!.command
|
||||
// print(command)
|
||||
if command == "windowLoaded" {
|
||||
// let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
|
||||
// webView.evaluateJavaScript("window.bitwardenApplicationVersion = '\(version!)';", completionHandler: nil)
|
||||
// Set things
|
||||
} else if command == "storage_get" {
|
||||
if command == "storage_get" {
|
||||
let obj = UserDefaults.standard.string(forKey: m!.data!)
|
||||
m!.responseData = obj
|
||||
replyMessage(message: m!)
|
||||
|
@ -14,15 +14,10 @@
|
||||
<div id="loading"><i class="fa fa-spinner fa-spin fa-3x"></i></div>
|
||||
</app-root>
|
||||
<script type="text/javascript">
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
window.safariAppExtension = true;
|
||||
window.bitwardenLocaleStrings = null;
|
||||
window.bitwardenApplicationVersion = null;
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
window.webkit.messageHandlers.bitwardenApp.postMessage(JSON.stringify({
|
||||
id: '123',
|
||||
command: 'windowLoaded'
|
||||
}));
|
||||
});
|
||||
window.bitwardenApplicationVersion = urlParams.get('appVersion');
|
||||
</script>
|
||||
<script type="text/javascript" src="../vendor.js"></script>
|
||||
<script type="text/javascript" src="../background.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user