mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Ignore nodes which does not contain elements
This commit is contained in:
parent
6ba29a70f2
commit
92cde01e03
1 changed files with 15 additions and 1 deletions
|
|
@ -1208,8 +1208,22 @@ cipObserverHelper.inputTypes = [
|
|||
null // Input field can be without any type. Include these to the list.
|
||||
];
|
||||
|
||||
// Ignores all nodes that doesn't contain elements
|
||||
cipObserverHelper.ignoredNode = function(target) {
|
||||
if (target.nodeType === Node.ATTRIBUTE_NODE ||
|
||||
target.nodeType === Node.TEXT_NODE ||
|
||||
target.nodeType === Node.CDATA_SECTION_NODE ||
|
||||
target.nodeType === Node.PROCESSING_INSTRUCTION_NODE ||
|
||||
target.nodeType === Node.COMMENT_NODE ||
|
||||
target.nodeType === Node.DOCUMENT_TYPE_NODE ||
|
||||
target.nodeType === Node.NOTATION_NODE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
cipObserverHelper.getInputs = function(target) {
|
||||
if (target.nodeType === Node.TEXT_NODE || target.nodeType === Node.COMMENT_NODE) {
|
||||
if (cipObserverHelper.ignoredNode(target)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue