-
-
Notifications
You must be signed in to change notification settings - Fork 205
Added option for connection timeout used when browser extension is trying to connect to KeePassXC #2752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Added option for connection timeout used when browser extension is trying to connect to KeePassXC #2752
Changes from 5 commits
5923319
1c82121
5a06415
0b63edb
a7ef451
511b9ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ const defaultSettings = { | |
| bannerPosition: BannerPosition.TOP, | ||
| checkUpdateKeePassXC: CHECK_UPDATE_NEVER, | ||
| clearCredentialsTimeout: 10, | ||
| connectionTimeout: 1500, | ||
| 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; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not used, and not needed. |
||
| page.currentRequest = {}; | ||
| page.currentTabId = -1; | ||
| page.isFirefox = false; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't do this. Just retrieve the value from settings and do any modifications to it when inserting it as element value. |
||
| $('#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,21 @@ 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) { | ||
| if (e.target.valueAsNumber < 1.5 || e.target.valueAsNumber > 60) { | ||
| return; | ||
| } | ||
|
|
||
| options.settings['connectionTimeout'] = e.target.valueAsNumber * 1000; | ||
Talkabout marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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); | ||
| }); | ||
|
|
@@ -726,7 +743,7 @@ options.initSitePreferences = function() { | |
|
|
||
| // Page URL | ||
| row.children[0].children[0].children[0].value = url; | ||
| row.children[0].children[0]?.addEventListener('dblclick', (e) => | ||
| row.children[0].children[0]?.addEventListener('dblclick', (e) => | ||
| enterEditMode(e, row, inputField, editButton, cancelButton, saveButton) | ||
| ); | ||
|
|
||
|
|
@@ -891,7 +908,7 @@ const getBrowserId = function(userAgent) { | |
| return `${query.name} ${getVersion(userAgent, query.findStr)}`; | ||
| } | ||
| } | ||
|
|
||
| return 'Other/Unknown'; | ||
| }; | ||
|
|
||
|
|
@@ -919,7 +936,7 @@ const updateDropdownPosition = function(e, dropdown) { | |
| if (!rect) { | ||
| return; | ||
| } | ||
|
|
||
| const zoom = getComputedStyle(document.body).zoom || 1; | ||
| const scrollTop = document.defaultView.scrollY / zoom; | ||
| const scrollLeft = document.defaultView?.scrollX / zoom; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.