Skip to content

Commit

Permalink
Update content.js
Browse files Browse the repository at this point in the history
Oops, forgot to iterate over the child nodes.
  • Loading branch information
ArjixWasTaken committed Oct 19, 2023
1 parent 5d702cc commit f0ae093
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ const tagName = "input";
new MutationObserver(async (mutations, observer) => {
for (const mutation of mutations) {
if (mutation.type !== "childList") continue;
if (mutation.target.tagName !== tagName.toUpperCase()) continue;
for (const child of mutation.addedNodes) {
if (child.tagName !== tagName.toUpperCase()) continue;

mutation.target.setAttribute("autocomplete", "off");
child.setAttribute("autocomplete", "off");
}
}
}).observe(document, { subtree: true, childList: true });

0 comments on commit f0ae093

Please sign in to comment.