commit
ace0a2b64f
@ -4,6 +4,6 @@ Give a short description about this pull request.
|
|||||||
|
|
||||||
## Browsers
|
## Browsers
|
||||||
|
|
||||||
[ ] Google Chrome (specify version if checked).
|
- [ ] Google Chrome (specify version if checked).
|
||||||
[ ] Microsoft Edge (specify version if checked).
|
- [ ] Microsoft Edge (specify version if checked).
|
||||||
[ ] Opera (specify version if checked).
|
- [ ] Opera (specify version if checked).
|
||||||
|
@ -1758,7 +1758,6 @@ tui-cookie-consent
|
|||||||
#privacy-shield
|
#privacy-shield
|
||||||
.kjfCookieInfoBox
|
.kjfCookieInfoBox
|
||||||
#policy-cookie-notice
|
#policy-cookie-notice
|
||||||
.ui-dialog
|
|
||||||
div[style^="color: rgb(238, 238, 238); background-color: rgb(102, 102, 51);"]
|
div[style^="color: rgb(238, 238, 238); background-color: rgb(102, 102, 51);"]
|
||||||
#accept_cookie
|
#accept_cookie
|
||||||
.global-alert--cookie-notice
|
.global-alert--cookie-notice
|
||||||
@ -2334,7 +2333,6 @@ suchen-cookie-privacy-toast
|
|||||||
#private-policy
|
#private-policy
|
||||||
#bt-privacy-header
|
#bt-privacy-header
|
||||||
#consent-toolbar
|
#consent-toolbar
|
||||||
.info.popup-content
|
|
||||||
.disclaimermessage
|
.disclaimermessage
|
||||||
.datenschutzhinweis
|
.datenschutzhinweis
|
||||||
#global-cookiewarning
|
#global-cookiewarning
|
||||||
@ -4024,7 +4022,6 @@ cru-cookie-policy
|
|||||||
.cookiemanager
|
.cookiemanager
|
||||||
.cookie__container
|
.cookie__container
|
||||||
#CNIL-cookie
|
#CNIL-cookie
|
||||||
.popup-content
|
|
||||||
#noteOnCookies
|
#noteOnCookies
|
||||||
.cookieClass
|
.cookieClass
|
||||||
#cookieAgree
|
#cookieAgree
|
||||||
@ -4745,7 +4742,6 @@ div[data-cmp-no-consent]
|
|||||||
.cookies__layover
|
.cookies__layover
|
||||||
[cookie-unique-name]
|
[cookie-unique-name]
|
||||||
#rodoNotificationWrapper
|
#rodoNotificationWrapper
|
||||||
#colorbox
|
|
||||||
.wp-gdpr-cookie-notice-wrap
|
.wp-gdpr-cookie-notice-wrap
|
||||||
#y-shade
|
#y-shade
|
||||||
.cookie_gdpr
|
.cookie_gdpr
|
||||||
@ -12551,4 +12547,18 @@ div[style="position: fixed; z-index: 9999; width: 100%; height: 100%; inset: 0px
|
|||||||
.w-cookies-popup__wrapper
|
.w-cookies-popup__wrapper
|
||||||
.w-cookies-popup
|
.w-cookies-popup
|
||||||
#CybotCookiebotDialogBodyUnderlay
|
#CybotCookiebotDialogBodyUnderlay
|
||||||
.tvcmscookies-notice
|
.tvcmscookies-notice
|
||||||
|
.ui-widget-overlay.ui-front
|
||||||
|
#policy-wrapper
|
||||||
|
div[id*="sp_message_container_"]
|
||||||
|
iframe[src="/legal/acuerdo_cookies.html"]
|
||||||
|
#popup[data-component="ePopup"]
|
||||||
|
#popupp[style="visibility: visible;"]
|
||||||
|
div[data-tracking-opt-in-overlay="true"][style="z-index: 9999999;"]
|
||||||
|
#cookie-compliant-conte
|
||||||
|
#idxrcookies
|
||||||
|
#cookieLoad
|
||||||
|
.cookieAcceptDiv
|
||||||
|
.fondo-popup-cookies
|
||||||
|
#cookie-consent-iframe
|
||||||
|
#cookies-caja
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Do Not Consent",
|
"name": "Do Not Consent",
|
||||||
"version": "3.0.3",
|
"version": "3.1.0",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_appDesc__",
|
"description": "__MSG_appDesc__",
|
||||||
"icons": {
|
"icons": {
|
||||||
@ -21,5 +21,6 @@
|
|||||||
"matches": ["http://*/*", "https://*/*"]
|
"matches": ["http://*/*", "https://*/*"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"permissions": ["storage", "unlimitedStorage"],
|
||||||
"web_accessible_resources": ["filters/index.txt"]
|
"web_accessible_resources": ["filters/index.txt"]
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,99 @@
|
|||||||
if (!!window.chrome) {
|
if (!!window.chrome) {
|
||||||
|
let attempts = 0;
|
||||||
|
const filtersUrl = chrome.runtime.getURL("filters/index.txt");
|
||||||
|
const options = {
|
||||||
|
attributes: true,
|
||||||
|
childList: true,
|
||||||
|
};
|
||||||
|
|
||||||
const fix = () => {
|
const fix = () => {
|
||||||
document.body.style = "overflow-y: unset !important;";
|
document.body.style = "overflow-y: unset !important;";
|
||||||
};
|
};
|
||||||
|
|
||||||
const observe = () => {
|
const retrieveElement = (match) => {
|
||||||
observer.observe(document.body, {
|
if (!match.includes("[") && !match.includes(">")) {
|
||||||
attributes: true,
|
if (match[0] === ".") {
|
||||||
childList: true,
|
return document.getElementsByClassName(match.slice(1))[0];
|
||||||
});
|
}
|
||||||
|
|
||||||
|
if (match[0] === "#") {
|
||||||
|
return document.getElementById(match.slice(1));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return document.querySelector(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const observer = new MutationObserver((mutations, observer) => {
|
const removeFromCache = () => {
|
||||||
mutations.forEach(async () => {
|
chrome.storage.local.get([document.location.hostname], (value) => {
|
||||||
observer.disconnect();
|
const matches = value[document.location.hostname];
|
||||||
fix();
|
|
||||||
await remove();
|
|
||||||
observe();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const remove = async () => {
|
if (matches && !!matches.length) {
|
||||||
const filtersUrl = chrome.runtime.getURL("filters/index.txt");
|
matches.forEach((match) => {
|
||||||
const text = await fetch(filtersUrl).then((res) => res.text());
|
const element = retrieveElement(match);
|
||||||
const filters = text.split("\n");
|
const tagName = element ? element.tagName.toUpperCase() : "";
|
||||||
|
|
||||||
filters.forEach((match) => {
|
if (element && !["BODY", "HTML"].includes(tagName)) {
|
||||||
const element = document.querySelector(match);
|
matches.push(match);
|
||||||
|
element.remove();
|
||||||
if (element && element.tagName !== "BODY" && element.tagName !== "HTML") {
|
}
|
||||||
element.remove();
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
(async () => {
|
const updateCache = (value) => {
|
||||||
fix();
|
chrome.storage.local.get([document.location.hostname], (store) => {
|
||||||
await remove();
|
const matches = store[document.location.hostname];
|
||||||
observe();
|
|
||||||
})();
|
if (matches && !!matches.length && !matches.includes(value)) {
|
||||||
|
chrome.storage.local.set({
|
||||||
|
[document.location.hostname]: [...new Set([...matches, value])],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
chrome.storage.local.set({
|
||||||
|
[document.location.hostname]: [value],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeFromFilters = async () => {
|
||||||
|
if (attempts < 3) {
|
||||||
|
const text = await fetch(filtersUrl).then((res) => res.text());
|
||||||
|
const filters = text.split("\n");
|
||||||
|
|
||||||
|
filters.forEach((match) => {
|
||||||
|
const element = retrieveElement(match);
|
||||||
|
const tagName = element ? element.tagName.toUpperCase() : "";
|
||||||
|
|
||||||
|
if (element && !["BODY", "HTML"].includes(tagName)) {
|
||||||
|
updateCache(match);
|
||||||
|
element.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const observer = new MutationObserver((mutations, observer) => {
|
||||||
|
mutations.forEach(() => {
|
||||||
|
observer.disconnect();
|
||||||
|
fix();
|
||||||
|
removeFromCache();
|
||||||
|
removeFromFilters();
|
||||||
|
attempts += 1;
|
||||||
|
observer.observe(document.body, options);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const observe = () => {
|
||||||
|
observer.observe(document.body, options);
|
||||||
|
};
|
||||||
|
|
||||||
|
fix();
|
||||||
|
removeFromCache();
|
||||||
|
removeFromFilters();
|
||||||
|
observe();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user