mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Improvements to isSearchField
This commit is contained in:
parent
a38c77fc80
commit
00f7071657
1 changed files with 15 additions and 4 deletions
|
|
@ -864,11 +864,22 @@ cipFields.isSearchField = function(target) {
|
|||
}
|
||||
}
|
||||
|
||||
// Check form action
|
||||
// Check closest form
|
||||
const closestForm = target.closest('form');
|
||||
const formAction = closestForm ? closestForm.getAttribute('action') : null;
|
||||
if (formAction && formAction.includes('search')) {
|
||||
return true;
|
||||
if (closestForm) {
|
||||
// Check form action
|
||||
const formAction = closestForm.getAttribute('action');
|
||||
if (formAction && formAction.includes('search')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check form class and id
|
||||
const closestFormId = closestForm.getAttribute('id');
|
||||
const closestFormClass = closestForm.className;
|
||||
if (closestFormClass && (closestForm.className.toLowerCase().includes('search') ||
|
||||
(closestFormId && closestFormId.toLowerCase().includes('search')))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check parent elements for role="search"
|
||||
|
|
|
|||
Loading…
Reference in a new issue