Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only rely on cookies #48

Merged
merged 6 commits into from
Jan 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOM mutatiions to not register multiple autofillable buttons
  • Loading branch information
dedoussis committed Jan 28, 2024
commit 60d6a7b5c3465fef8abf661608e3c7f99627feb9
11 changes: 8 additions & 3 deletions src/pages/Content/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ export default async function main(): Promise<void> {
const addedElements = node.querySelectorAll<HTMLInputElement>(
EMAIL_INPUT_QUERY_STRING
);
addedElements.forEach((el) =>
autofillableInputElements.push(makeAutofillableInputElement(el))
);
addedElements.forEach((el) => {
const elementExists = autofillableInputElements.some((item) =>
el.isEqualNode(item.inputElement)
);
if (!elementExists) {
autofillableInputElements.push(makeAutofillableInputElement(el));
}
});
});

mutation.removedNodes.forEach((node) => {
Expand Down
Loading