Skip to content

Commit

Permalink
Merge pull request #2411 from keepassxreboot/fix/add_checks_for_treew…
Browse files Browse the repository at this point in the history
…alker_filter

Add checks for TreeWalker filter
  • Loading branch information
varjolintu authored Dec 15, 2024
2 parents d614bb3 + 04f08c9 commit a277d6c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions keepassxc-browser/content/observer-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ const getShadowDOM = function(elem) {

// Filter for TreeWalker
const treeWalkerFilter = function(node) {
return !node || node.disabled || node.getLowerCaseAttribute('type') === 'hidden'
? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
return !node ||
node?.disabled ||
(typeof node?.getAttribute !== 'undefined' && node?.getLowerCaseAttribute('type') === 'hidden')
? NodeFilter.FILTER_REJECT
: NodeFilter.FILTER_ACCEPT;
};

// Traverses all child elements, looking for input fields inside Shadow DOM
Expand Down

0 comments on commit a277d6c

Please sign in to comment.