diff --git a/keepassxc-browser/_locales/de/messages.json b/keepassxc-browser/_locales/de/messages.json index 7d2107c..d4d7bf0 100644 --- a/keepassxc-browser/_locales/de/messages.json +++ b/keepassxc-browser/_locales/de/messages.json @@ -1018,6 +1018,14 @@ "message": "Anmeldedaten werden nach dem Timeout aus Hintergrund-Tabs entfernt. Für diese Seiten wird erneut um Erlaubnis gebeten.", "description": "Clear credentials timeout help text." }, + "optionsConnectionTimeout": { + "message": "KeepassXC Zeitlimit für die Verbindung (Sekunden, 2-60).", + "description": "Connection timeout label text." + }, + "optionsConnectionTimeoutHelpText": { + "message": "Wenn die KeePassXC Browser Erweiterung versucht, sich mit KeePass zu verbinden, wird dieses Zeitlimit verwendet.", + "description": "Connection timeout label text." + }, "optionsVersionInfoText": { "message": "KeePassXC-Browser benötigt KeePassXC, um Anmeldedaten abzurufen.", "description": "Settings page version info text." diff --git a/keepassxc-browser/_locales/en/messages.json b/keepassxc-browser/_locales/en/messages.json index b58595d..d586cc0 100644 --- a/keepassxc-browser/_locales/en/messages.json +++ b/keepassxc-browser/_locales/en/messages.json @@ -1022,6 +1022,14 @@ "message": "Credentials are cleared from background tabs after the timeout and permissions for those pages will be asked again.", "description": "Clear credentials timeout help text." }, + "optionsConnectionTimeout": { + "message": "KeepassXC connection timeout (seconds, 2-60).", + "description": "Connection timeout label text." + }, + "optionsConnectionTimeoutHelpText": { + "message": "When KeePassXC browser extension tries to connect to to keepass, this timeout value is used", + "description": "Connection timeout label text." + }, "optionsVersionInfoText": { "message": "KeePassXC-Browser needs KeePassXC to retrieve credentials.", "description": "Settings page version info text." diff --git a/keepassxc-browser/_locales/en_GB/messages.json b/keepassxc-browser/_locales/en_GB/messages.json index ef8d012..39bc0e8 100644 --- a/keepassxc-browser/_locales/en_GB/messages.json +++ b/keepassxc-browser/_locales/en_GB/messages.json @@ -1018,6 +1018,14 @@ "message": "Credentials are cleared from background tabs after the timeout, and permissions for those pages will be asked again.", "description": "Clear credentials timeout help text." }, + "optionsConnectionTimeout": { + "message": "KeepassXC connection timeout (seconds, 2-60).", + "description": "Connection timeout label text." + }, + "optionsConnectionTimeoutHelpText": { + "message": "When KeePassXC browser extension tries to connect to to keepass, this timeout value is used", + "description": "Connection timeout label text." + }, "optionsVersionInfoText": { "message": "KeePassXC-Browser needs KeePassXC to retrieve credentials.", "description": "Settings page version info text." diff --git a/keepassxc-browser/background/keepass.js b/keepassxc-browser/background/keepass.js index c1d1367..7f1ee3d 100755 --- a/keepassxc-browser/background/keepass.js +++ b/keepassxc-browser/background/keepass.js @@ -804,7 +804,11 @@ keepass.disableAutomaticReconnect = function() { keepass.reconnectLoop = null; }; -keepass.reconnect = async function(tab = null, connectionTimeout = 1500) { +keepass.reconnect = async function(tab = null, connectionTimeout = -1) { + if (connectionTimeout == -1) { + connectionTimeout = page.settings.connectionTimeout * 1000; + } + keepassClient.connectToNative(); keepass.generateNewKeyPair(); const keyChangeResult = await keepass.changePublicKeys(tab, !!connectionTimeout, connectionTimeout).catch(() => false); diff --git a/keepassxc-browser/background/page.js b/keepassxc-browser/background/page.js index 4020a1b..fbe17ec 100755 --- a/keepassxc-browser/background/page.js +++ b/keepassxc-browser/background/page.js @@ -14,6 +14,7 @@ const defaultSettings = { bannerPosition: BannerPosition.TOP, checkUpdateKeePassXC: CHECK_UPDATE_NEVER, clearCredentialsTimeout: 10, + connectionTimeout: 2, colorTheme: 'system', credentialSorting: SORT_BY_GROUP_AND_TITLE, debugLogging: false, @@ -47,6 +48,7 @@ page.autoSubmitPerformed = false; page.attributeMenuItems = []; page.blockedTabs = []; page.clearCredentialsTimeout = null; +page.connectionTimeout = null; page.currentRequest = {}; page.currentTabId = -1; page.isFirefox = false; diff --git a/keepassxc-browser/managed_storage.json b/keepassxc-browser/managed_storage.json index 21af9b8..a09abf0 100644 --- a/keepassxc-browser/managed_storage.json +++ b/keepassxc-browser/managed_storage.json @@ -52,6 +52,10 @@ "title": "Clear credential info from tabs after timeout. Default (seconds): 10", "type": "integer" }, + "connectionTimeout": { + "title": "Connection timeout to KeePassXC. Default (seconds): 2", + "type": "integer" + }, "colorTheme": { "title": "Extension color scheme. Default: system", "type": "string" diff --git a/keepassxc-browser/options/options.html b/keepassxc-browser/options/options.html index 4dd97d0..35683e0 100644 --- a/keepassxc-browser/options/options.html +++ b/keepassxc-browser/options/options.html @@ -531,6 +531,16 @@
+ + +