Skip to content

Commit

Permalink
Merge pull request #3 from ArjixWasTaken/patch-1
Browse files Browse the repository at this point in the history
fix: MutationObserver
  • Loading branch information
illegalsolutions committed Oct 19, 2023
2 parents 5d702cc + f0ae093 commit df4dd4a
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 df4dd4a

Please sign in to comment.