feat: improve performance
This commit is contained in:
parent
7c88ce8260
commit
02c5fdd00d
@ -12526,6 +12526,7 @@ amedia-privacybox
|
||||
#sprd-consent
|
||||
#sd-cmp
|
||||
#cl-consent
|
||||
.cl-consent
|
||||
script[src="//clickio.mgr.consensu.org/t/consent_216889.js"]
|
||||
#didomi-host
|
||||
#didomi-popup
|
||||
@ -12565,4 +12566,8 @@ div[data-testid="cookie-policy-banner"]
|
||||
#cookie-compliant-fondo
|
||||
#cmpbox
|
||||
div[data-component="global/PopUpFromCookie"]
|
||||
div[data-testid="cookie-policy-dialog"]
|
||||
div[data-testid="cookie-policy-dialog"]
|
||||
div[aria-labelledby="cookie_banner_title"]
|
||||
.popover-cover zIndex--fixed
|
||||
#_evidon-background
|
||||
.evidon-background
|
@ -32,23 +32,6 @@ const observe = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const removeFromCache = () => {
|
||||
chrome.storage.local.get([document.location.hostname], (value) => {
|
||||
const matches = value[document.location.hostname];
|
||||
|
||||
if (matches && !!matches.length) {
|
||||
for (let i = 0; i < matches.length; i++) {
|
||||
const element = retrieveElement(matches[i]);
|
||||
const tagName = element ? element.tagName.toUpperCase() : "";
|
||||
|
||||
if (element && !["BODY", "HTML"].includes(tagName)) {
|
||||
element.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const updateCache = (value) => {
|
||||
chrome.storage.local.get([document.location.hostname], (store) => {
|
||||
const matches = store[document.location.hostname];
|
||||
@ -61,16 +44,33 @@ const updateCache = (value) => {
|
||||
});
|
||||
};
|
||||
|
||||
const removeFromCache = () => {
|
||||
chrome.storage.local.get([document.location.hostname], (value) => {
|
||||
const matches = value[document.location.hostname];
|
||||
|
||||
if (matches && !!matches.length) {
|
||||
for (let i = matches.length; i--; ) {
|
||||
const element = retrieveElement(matches[i]);
|
||||
const tagName = element ? element.tagName.toUpperCase() : "";
|
||||
|
||||
if (element && !["BODY", "HTML"].includes(tagName)) {
|
||||
element.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const removeFromFilters = () => {
|
||||
if (attempts < 5) {
|
||||
for (let i = 0; i < filters.length; i++) {
|
||||
for (let i = filters.length; i--; ) {
|
||||
const match = filters[i];
|
||||
const element = retrieveElement(match);
|
||||
const tagName = element ? element.tagName.toUpperCase() : "";
|
||||
|
||||
if (element && !["BODY", "HTML"].includes(tagName)) {
|
||||
element.innerHTML = "";
|
||||
updateCache(match);
|
||||
element.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user