Skip to content

Commit

Permalink
Update content.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjixWasTaken authored Oct 19, 2023
1 parent 8094390 commit 25b37df
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions content.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
/*document.querySelectorAll('input').forEach( input => {
input.setAttribute("autocomplete", "off")
});*/

function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}

function AutocompleteOFF(tagi) {
eleme = document.getElementsByTagName(tagi);
for (index = 0; index < eleme.length; ++index) {
eleme[index].setAttribute("autocomplete", "off")
}
}

//AutocompleteOFF('input');

document.onmousemove = function makeOK() {
AutocompleteOFF('input');
}
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;

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

0 comments on commit 25b37df

Please sign in to comment.