mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge 511b9ed32e into 64fda92e27
This commit is contained in:
commit
2715a629e4
7 changed files with 46 additions and 3 deletions
|
|
@ -1038,6 +1038,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: $1 seconds",
|
||||
"description": "Connection timeout label text."
|
||||
},
|
||||
"optionsConnectionTimeoutHelpText": {
|
||||
"message": "When KeePassXC browser extension tries to connect to to keepass, this timeout value is used. Default value is 1.5. Maximum is 60.0.",
|
||||
"description": "Connection timeout label text."
|
||||
},
|
||||
"optionsVersionInfoText": {
|
||||
"message": "KeePassXC-Browser needs KeePassXC to retrieve credentials.",
|
||||
"description": "Settings page version info text."
|
||||
|
|
|
|||
|
|
@ -821,7 +821,12 @@ keepass.disableAutomaticReconnect = function() {
|
|||
keepass.reconnectLoop = null;
|
||||
};
|
||||
|
||||
keepass.reconnect = async function(tab = null, connectionTimeout = 1500) {
|
||||
keepass.reconnect = async function(tab = null, connectionTimeout = CONNECTION_TIMEOUT) {
|
||||
if (arguments.length < 2) {
|
||||
connectionTimeout = page.settings.connectionTimeout;
|
||||
}
|
||||
|
||||
connectionTimeout = Math.min(60000, Math.max(CONNECTION_TIMEOUT, connectionTimeout))
|
||||
keepassClient.connectToNative();
|
||||
keepass.generateNewKeyPair();
|
||||
const keyChangeResult = await keepass
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const defaultSettings = {
|
|||
bannerPosition: BannerPosition.TOP,
|
||||
checkUpdateKeePassXC: CHECK_UPDATE_NEVER,
|
||||
clearCredentialsTimeout: 10,
|
||||
connectionTimeout: CONNECTION_TIMEOUT,
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ const CHECK_UPDATE_THREE_DAYS = 3;
|
|||
const CHECK_UPDATE_ONE_WEEK = 7;
|
||||
const CHECK_UPDATE_ONE_MONTH = 30;
|
||||
|
||||
// Default value for connection timeout
|
||||
const CONNECTION_TIMEOUT = 1500;
|
||||
|
||||
const URL_WILDCARD = '1kpxcwc1';
|
||||
const schemeSegment = '(\\*|http|https|ws|wss|ftp)';
|
||||
const hostSegment = '(\\*|(?:\\*\\.)?(?:[^/*]+))?';
|
||||
|
|
|
|||
|
|
@ -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): 1.5",
|
||||
"type": "integer"
|
||||
},
|
||||
"colorTheme": {
|
||||
"title": "Extension color scheme. Default: system",
|
||||
"type": "string"
|
||||
|
|
|
|||
|
|
@ -537,6 +537,14 @@
|
|||
<div class="form-text" data-i18n="optionsClearCredentialsTimeoutHelpText"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Keepass connectiontimeout -->
|
||||
<div class="form-group mt-2 pb-1">
|
||||
<label id="connectionTimeoutLabel" class="font-weight-normal" for="connectionTimeout" data-i18n="optionsConnectionTimeout" data-i18n-placeholder="1.5"></label>
|
||||
<input type="range" class="form-range" id="connectionTimeout" name="connectionTimeout" min="1.5" max="60.0" step="0.5" value="1.5">
|
||||
<div class="form-text" data-i18n="optionsConnectionTimeoutHelpText"></div>
|
||||
</div>
|
||||
|
||||
<!-- Debug logging -->
|
||||
<div class="form-group mt-2 pb-1">
|
||||
<div class="form-check form-switch">
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ options.initGeneralSettings = async function() {
|
|||
$('#tab-general-settings input[type=radio]#checkUpdateOneMonth').value = CHECK_UPDATE_ONE_MONTH;
|
||||
$('#tab-general-settings input[type=radio]#checkUpdateNever').value = CHECK_UPDATE_NEVER;
|
||||
|
||||
$('#tab-general-settings input[type=range]').value = options.settings['redirectAllowance'];
|
||||
$('#tab-general-settings #redirectAllowance').value = options.settings['redirectAllowance'];
|
||||
$('#redirectAllowanceLabel').textContent = tr('optionsRedirectAllowance',
|
||||
options.settings['redirectAllowance'] === 11 ? 'Infinite' : String(options.settings['redirectAllowance']));
|
||||
|
||||
|
|
@ -124,6 +124,9 @@ options.initGeneralSettings = async function() {
|
|||
$('#tab-general-settings input#defaultGroup').value = options.settings['defaultGroup'];
|
||||
$('#tab-general-settings input#defaultPasskeyGroup').value = options.settings['defaultPasskeyGroup'];
|
||||
$('#tab-general-settings input#clearCredentialTimeout').value = options.settings['clearCredentialsTimeout'];
|
||||
const connectionTimeout = (options.settings['connectionTimeout']/1000);
|
||||
$('#tab-general-settings input#connectionTimeout').value = connectionTimeout;
|
||||
$('#connectionTimeoutLabel').textContent = tr('optionsConnectionTimeout', String(connectionTimeout));
|
||||
|
||||
const generalSettingsRadioInputs = document.querySelectorAll('#tab-general-settings input[type=radio]');
|
||||
for (const radio of generalSettingsRadioInputs) {
|
||||
|
|
@ -173,7 +176,17 @@ options.initGeneralSettings = async function() {
|
|||
});
|
||||
|
||||
// Change label text dynamically with the range input
|
||||
$('#tab-general-settings input[type=range]').addEventListener('input', function(e) {
|
||||
$('#tab-general-settings input#connectionTimeout').addEventListener('input', function(e) {
|
||||
$('#connectionTimeoutLabel').textContent = tr('optionsConnectionTimeout', e.target.value);
|
||||
});
|
||||
|
||||
$('#tab-general-settings input#connectionTimeout').addEventListener('change', async function(e) {
|
||||
options.settings['connectionTimeout'] = Math.min(60000, Math.max(CONNECTION_TIMEOUT, e.target.valueAsNumber * 1000))
|
||||
await options.saveSettings();
|
||||
});
|
||||
|
||||
// Change label text dynamically with the range input
|
||||
$('#tab-general-settings input#redirectAllowance').addEventListener('input', function(e) {
|
||||
const currentValue = e.target.valueAsNumber === 11 ? 'Infinite' : e.target.value;
|
||||
$('#redirectAllowanceLabel').textContent = tr('optionsRedirectAllowance', currentValue);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue