feat: improve performance
This commit is contained in:
parent
7c88ce8260
commit
02c5fdd00d
@ -12526,6 +12526,7 @@ amedia-privacybox
|
|||||||
#sprd-consent
|
#sprd-consent
|
||||||
#sd-cmp
|
#sd-cmp
|
||||||
#cl-consent
|
#cl-consent
|
||||||
|
.cl-consent
|
||||||
script[src="//clickio.mgr.consensu.org/t/consent_216889.js"]
|
script[src="//clickio.mgr.consensu.org/t/consent_216889.js"]
|
||||||
#didomi-host
|
#didomi-host
|
||||||
#didomi-popup
|
#didomi-popup
|
||||||
@ -12566,3 +12567,7 @@ div[data-testid="cookie-policy-banner"]
|
|||||||
#cmpbox
|
#cmpbox
|
||||||
div[data-component="global/PopUpFromCookie"]
|
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) => {
|
const updateCache = (value) => {
|
||||||
chrome.storage.local.get([document.location.hostname], (store) => {
|
chrome.storage.local.get([document.location.hostname], (store) => {
|
||||||
const matches = store[document.location.hostname];
|
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 = () => {
|
const removeFromFilters = () => {
|
||||||
if (attempts < 5) {
|
if (attempts < 5) {
|
||||||
for (let i = 0; i < filters.length; i++) {
|
for (let i = filters.length; i--; ) {
|
||||||
const match = filters[i];
|
const match = filters[i];
|
||||||
const element = retrieveElement(match);
|
const element = retrieveElement(match);
|
||||||
const tagName = element ? element.tagName.toUpperCase() : "";
|
const tagName = element ? element.tagName.toUpperCase() : "";
|
||||||
|
|
||||||
if (element && !["BODY", "HTML"].includes(tagName)) {
|
if (element && !["BODY", "HTML"].includes(tagName)) {
|
||||||
|
element.innerHTML = "";
|
||||||
updateCache(match);
|
updateCache(match);
|
||||||
element.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user