From 532ecc299ca5a5819b7f3659993d8a8447ca46aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Mart=C3=ADnez?= Date: Fri, 3 Dec 2021 10:58:53 -0400 Subject: [PATCH] feat(data): add new elements and improve loops performance --- data/elements.txt | 15 ++++++++++++++- scripts/content.js | 8 ++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/data/elements.txt b/data/elements.txt index 366d35b..0eb2e9d 100644 --- a/data/elements.txt +++ b/data/elements.txt @@ -12473,4 +12473,17 @@ body#Viewport.hide-outline > .default > div[aria-modal="true"][role="dialog"] wsp-modal-window[data-type="cookie-modal"] #lgcookieslaw_modal .no-js > body > .headertopfixed.fixed ~ .bg_popup -#data-cookie \ No newline at end of file +#data-cookie +.overlay-context.no-banner[data-v-5b5bbc81] +.cc_css_reboot.cc_dialog.dark.headline +[data-component-id="banner"] +._3RhWPJfjpsEoBw52x0fQp2 +.nav-new-cookie-disclaimer +.js-notification.js-notification-cookie-banner.notification.notification-fixed-bottom.notification-foreground +.ix.u.kh.ki.kj.kk.kl.km.kn.ko.kp.kq.kr.ks.dj.cw.kt.ku.kv +[widgetid="PopupSignupForm_0"] > div.mc-modal[data-dojo-attach-point="modalContainer"] +#mw-mf-viewport #article_courses_banner +div#termsandconds[data-backdrop="static"] +div.ec-notices.ec-notices--animation-default.ec-notices--order-direct.ec-notices--fixed.ec-notices--top.ec-notices--right +div._1MLS_xjiUjam_u2qmURY4i[data-tracking-opt-in-overlay="true"] +div.notification--1vSvk.entered--3hIPp[role="alert"] \ No newline at end of file diff --git a/scripts/content.js b/scripts/content.js index e578a31..2d7beee 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -139,13 +139,13 @@ const observer = new MutationObserver((mutations, instance) => { fix(); if (!isPreview) { - mutations.forEach((mutation) => { - mutation.addedNodes.forEach((node) => { + for (const mutation of mutations) { + for (const node of mutation.addedNodes) { const valid = check(node); if (valid && node.matches(selectors)) node.outerHTML = ""; - }); - }); + } + } } instance.observe(target, options);