diff --git a/content_script.js b/content_script.js index a8d3b5d..5fd1d16 100644 --- a/content_script.js +++ b/content_script.js @@ -333,12 +333,7 @@ const enterTitleAndActivateCountryDropdown = { const enterCountry = { name: "enterCountry", expects: "mutation", - match: mutation => { - return mutation.target.parentNode.parentNode.classList.contains("test-adresse-land") && - Array.from(mutation.addedNodes).some( - n => n.nodeType === Node.ELEMENT_NODE && - n.classList.contains("db-web-dropdown-outer-container")) - }, + match: mut => matchDropdown(mut, "test-adresse-land", "open"), execute: () => { ensureSettingsProp("addr__country", v => { const selectList = $(".test-adresse-land ul"); @@ -354,13 +349,8 @@ const enterCountry = { const enterTextPersonalData = { name: "enterTextPersonalData", expects: 'mutation', - /** @param {MutationRecord} mutation */ - match: mutation => { - return (mutation.target.parentNode.parentNode.classList.contains("test-name-titel") && - Array.from(mutation.removedNodes).some( - n => n.nodeType === Node.ELEMENT_NODE && - n.classList.contains("db-web-dropdown-outer-container"))) - }, + /** @param {MutationRecord} mut */ + match: mut => matchDropdown(mut, "test-name-titel", "close"), execute: () => { let node = document; let delay = 100;