@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "Eine Erweiterung, mit der Sie Cookie-Zustimmungsdialoge automatisch löschen können",
|
"description": "Hat jemand Dialoge zur Cookie-Zustimmung gesagt? 😋",
|
||||||
"message": "Eine Erweiterung, mit der Sie Cookie-Zustimmungsdialoge automatisch löschen können"
|
"message": "Hat jemand Dialoge zur Cookie-Zustimmung gesagt? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "An extension that allows you to remove cookie consent dialogs automatically",
|
"description": "Did someone say cookie consent dialogs? 😋",
|
||||||
"message": "An extension that allows you to remove cookie consent dialogs automatically"
|
"message": "Did someone say cookie consent dialogs? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "Una extensión que te permite eliminar los diálogos de consentimiento de cookies automáticamente",
|
"description": "¿Alguien dijo diálogos de consentimiento de cookies? 😋",
|
||||||
"message": "Una extensión que te permite eliminar los diálogos de consentimiento de cookies automáticamente"
|
"message": "¿Alguien dijo diálogos de consentimiento de cookies? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Une extension qui vous permet de supprimer les boîtes de dialogue de consentement aux cookies"
|
"description": "Quelqu'un a-t-il dit boîtes de dialogue de consentement aux cookies? 😋",
|
||||||
|
"message": "Quelqu'un a-t-il dit boîtes de dialogue de consentement aux cookies? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "Un'estensione che consente di eliminare automaticamente i dialoghi di consenso sui cookie",
|
"description": "Qualcuno ha detto finestre di dialogo per il consenso ai cookie? 😋",
|
||||||
"message": "Un'estensione che consente di eliminare automaticamente i dialoghi di consenso sui cookie"
|
"message": "Qualcuno ha detto finestre di dialogo per il consenso ai cookie? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "Uma extensão que permite excluir automaticamente as caixas de diálogo de consentimento de cookies",
|
"description": "Alguém disse diálogos de consentimento de cookies? 😋",
|
||||||
"message": "Uma extensão que permite excluir automaticamente as caixas de diálogo de consentimento de cookies"
|
"message": "Alguém disse diálogos de consentimento de cookies? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "Uma extensão que permite excluir automaticamente as caixas de diálogo de consentimento de cookies",
|
"description": "Alguém disse diálogos de consentimento de cookies? 😋",
|
||||||
"message": "Uma extensão que permite excluir automaticamente as caixas de diálogo de consentimento de cookies"
|
"message": "Alguém disse diálogos de consentimento de cookies? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "O extensie care vă permite să ștergeți automat dialogurile de consimțământ cookie",
|
"description": "A spus cineva dialoguri de consimțământ pentru cookie? 😋",
|
||||||
"message": "O extensie care vă permite să ștergeți automat dialogurile de consimțământ cookie"
|
"message": "A spus cineva dialoguri de consimțământ pentru cookie? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appDesc": {
|
"appDesc": {
|
||||||
"description": "Расширение, позволяющее автоматически удалять диалоги согласия на использование файлов cookie",
|
"description": "Кто-то сказал диалоги согласия на использование файлов cookie? 😋",
|
||||||
"message": "Расширение, позволяющее автоматически удалять диалоги согласия на использование файлов cookie"
|
"message": "Кто-то сказал диалоги согласия на использование файлов cookie? 😋"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1016 B |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 1.9 KiB |
3
data/classes.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
no-scroll
|
||||||
|
sp-message-open
|
||||||
|
ta-cc-modal-open
|
@ -11937,7 +11937,6 @@ div[data-section-type="CookiesBanner"]
|
|||||||
.pageCookies
|
.pageCookies
|
||||||
.block-cipix-cookiecontrol
|
.block-cipix-cookiecontrol
|
||||||
#header-coockie
|
#header-coockie
|
||||||
#notify-container
|
|
||||||
#cookie-information-bar
|
#cookie-information-bar
|
||||||
.mcl-cookie-bar
|
.mcl-cookie-bar
|
||||||
#legalWarning
|
#legalWarning
|
||||||
@ -12465,3 +12464,4 @@ correos-cdk-cookies-module
|
|||||||
#cookies-block
|
#cookies-block
|
||||||
#cmp-app-container
|
#cmp-app-container
|
||||||
#ArsysCookieAcceptance
|
#ArsysCookieAcceptance
|
||||||
|
#cookie-law-info-bar
|
@ -1,6 +1,6 @@
|
|||||||
# Do Not Consent
|
# Cookie Monster Dialog
|
||||||
|
|
||||||
An extension that allows you to remove cookie consent dialogs automatically.
|
A browser extension that eats cookie consent dialogs.
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Do Not Consent",
|
"name": "Cookie Dialog Monster",
|
||||||
"version": "4.3.1",
|
"version": "5.0.0",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_appDesc__",
|
"description": "__MSG_appDesc__",
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "assets/icons/16.png",
|
"16": "assets/icons/16.png",
|
||||||
"32": "assets/icons/32.png",
|
|
||||||
"48": "assets/icons/48.png",
|
"48": "assets/icons/48.png",
|
||||||
"128": "assets/icons/128.png"
|
"128": "assets/icons/128.png"
|
||||||
},
|
},
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_icon": "assets/icons/disabled.png",
|
"default_icon": "assets/icons/disabled.png",
|
||||||
"default_title": "Do Not Consent"
|
"default_title": "Cookie Dialog Monster"
|
||||||
},
|
},
|
||||||
"author": "wanhose",
|
"author": "wanhose",
|
||||||
"background": {
|
"background": {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<h1 class="header-title">Do Not Consent</h1>
|
<h1 class="header-title">Cookie Dialog Monster</h1>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<button id="reload">
|
<button id="reload">
|
||||||
<svg
|
<svg
|
||||||
@ -34,7 +34,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<label class="switch-label">
|
<label class="switch-label">
|
||||||
<span>Hide irritating dialogs on <strong id="host"></strong></span>
|
<span>Eating dialogs in <strong id="host"></strong></span>
|
||||||
<div class="switch">
|
<div class="switch">
|
||||||
<input checked="checked" id="power" type="checkbox" />
|
<input checked="checked" id="power" type="checkbox" />
|
||||||
<span class="slider"></span>
|
<span class="slider"></span>
|
||||||
|
@ -101,6 +101,54 @@ const getCache = (hostname, responseCallback) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @async
|
||||||
|
* @function getClasses
|
||||||
|
* @description Retrieves a selectors list
|
||||||
|
*
|
||||||
|
* @param {void} [responseCallback]
|
||||||
|
* @returns {Promise<{ matches: string[] }>} A selectors list
|
||||||
|
*/
|
||||||
|
|
||||||
|
const getClasses = async (responseCallback) => {
|
||||||
|
try {
|
||||||
|
const url =
|
||||||
|
"https://raw.githubusercontent.com/wanhose/do-not-consent/master/data/classes.txt";
|
||||||
|
const response = await fetch(url);
|
||||||
|
const data = await response.text();
|
||||||
|
|
||||||
|
if (response.status !== 200) throw new Error();
|
||||||
|
|
||||||
|
responseCallback({ classes: data.split("\n") });
|
||||||
|
} catch {
|
||||||
|
responseCallback({ classes: [] });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @async
|
||||||
|
* @function getSelectors
|
||||||
|
* @description Retrieves a selectors list
|
||||||
|
*
|
||||||
|
* @param {void} [responseCallback]
|
||||||
|
* @returns {Promise<{ matches: string[] }>} A selectors list
|
||||||
|
*/
|
||||||
|
|
||||||
|
const getSelectors = async (responseCallback) => {
|
||||||
|
try {
|
||||||
|
const url =
|
||||||
|
"https://raw.githubusercontent.com/wanhose/do-not-consent/master/data/elements.txt";
|
||||||
|
const response = await fetch(url);
|
||||||
|
const data = await response.text();
|
||||||
|
|
||||||
|
if (response.status !== 200) throw new Error();
|
||||||
|
|
||||||
|
responseCallback({ selectors: data.split("\n") });
|
||||||
|
} catch {
|
||||||
|
responseCallback({ selectors: [] });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function getTab
|
* @function getTab
|
||||||
* @description Retrieves current tab information
|
* @description Retrieves current tab information
|
||||||
@ -118,30 +166,6 @@ const getTab = (responseCallback) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @async
|
|
||||||
* @function getList
|
|
||||||
* @description Retrieves selectors list
|
|
||||||
*
|
|
||||||
* @param {void} [responseCallback]
|
|
||||||
* @returns {Promise<{ matches: string[] }>} A selectors list
|
|
||||||
*/
|
|
||||||
|
|
||||||
const getList = async (responseCallback) => {
|
|
||||||
try {
|
|
||||||
const url =
|
|
||||||
"https://raw.githubusercontent.com/wanhose/do-not-consent/master/data/elements.txt";
|
|
||||||
const response = await fetch(url);
|
|
||||||
const data = await response.text();
|
|
||||||
|
|
||||||
if (response.status !== 200) throw new Error();
|
|
||||||
|
|
||||||
responseCallback({ selectors: data.split("\n") });
|
|
||||||
} catch {
|
|
||||||
responseCallback({ selectors: [] });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function updateCache
|
* @function updateCache
|
||||||
* @description Update cache state
|
* @description Update cache state
|
||||||
@ -200,8 +224,11 @@ chrome.runtime.onMessage.addListener((request, sender, responseCallback) => {
|
|||||||
case "GET_CACHE":
|
case "GET_CACHE":
|
||||||
getCache(request.hostname, responseCallback);
|
getCache(request.hostname, responseCallback);
|
||||||
break;
|
break;
|
||||||
case "GET_LIST":
|
case "GET_CLASSES":
|
||||||
getList(responseCallback);
|
getClasses(responseCallback);
|
||||||
|
break;
|
||||||
|
case "GET_SELECTORS":
|
||||||
|
getSelectors(responseCallback);
|
||||||
break;
|
break;
|
||||||
case "GET_TAB":
|
case "GET_TAB":
|
||||||
getTab(responseCallback);
|
getTab(responseCallback);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* @var attempts
|
|
||||||
* @description Number of attempts
|
* @description Number of attempts
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
@ -7,7 +6,13 @@
|
|||||||
let attempts = 1;
|
let attempts = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constant dispatch
|
* @description Array of selectors
|
||||||
|
* @type {string[]}
|
||||||
|
*/
|
||||||
|
|
||||||
|
let classesFromNetwork = [];
|
||||||
|
|
||||||
|
/**
|
||||||
* @description Shortcut to send messages to background script
|
* @description Shortcut to send messages to background script
|
||||||
* @type {void}
|
* @type {void}
|
||||||
*/
|
*/
|
||||||
@ -15,15 +20,6 @@ let attempts = 1;
|
|||||||
const dispatch = chrome.runtime.sendMessage;
|
const dispatch = chrome.runtime.sendMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var intervalId
|
|
||||||
* @description Task interval identifier
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
|
|
||||||
let intervalId = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var selectorsFromCache
|
|
||||||
* @description Array of selectors
|
* @description Array of selectors
|
||||||
* @type {string[]}
|
* @type {string[]}
|
||||||
*/
|
*/
|
||||||
@ -31,30 +27,92 @@ let intervalId = 0;
|
|||||||
let selectorsFromCache = [];
|
let selectorsFromCache = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var selectorsFromNetwork
|
|
||||||
* @description Array of selectors
|
* @description Array of selectors
|
||||||
* @type {string[]}
|
* @type {Promise<string[]>[]}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let selectorsFromNetwork = [];
|
let selectorsFromNetwork = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function fix
|
* @description Split large arrays into promises
|
||||||
* @description Fix scroll issues
|
* @param {string[]} array
|
||||||
|
*/
|
||||||
|
|
||||||
|
const chunkerize = (array) =>
|
||||||
|
[...Array(Math.ceil(array.length / 300))].map(
|
||||||
|
(_, index) => () =>
|
||||||
|
new Promise((resolve) => {
|
||||||
|
removeElements(array.slice(index * 300, (index + 1) * 300), true);
|
||||||
|
resolve(true);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Fixes scroll issues
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fix = () => {
|
const fix = () => {
|
||||||
const body = document.body;
|
const body = document.body;
|
||||||
const classListToRemove = ["ta-cc-modal-open"];
|
const classes = classesFromNetwork;
|
||||||
const facebook = document.getElementsByClassName("_31e")[0];
|
const facebook = document.getElementsByClassName("_31e")[0];
|
||||||
const html = document.documentElement;
|
const html = document.documentElement;
|
||||||
|
|
||||||
if (body) body.classList.remove(...classListToRemove);
|
if (body && classes.length > 0) body.classList.remove(...classes);
|
||||||
if (body) body.style.setProperty("overflow-y", "unset", "important");
|
if (body) body.style.setProperty("overflow-y", "unset", "important");
|
||||||
if (facebook) facebook.style.setProperty("position", "unset", "important");
|
if (facebook) facebook.style.setProperty("position", "unset", "important");
|
||||||
if (html) html.style.setProperty("overflow-y", "unset", "important");
|
if (html) html.style.setProperty("overflow-y", "unset", "important");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function removeElements
|
||||||
|
* @description Removes matched elements from a selectors array
|
||||||
|
* @param {string[]} selectors
|
||||||
|
* @param {boolean} updateCache
|
||||||
|
*/
|
||||||
|
|
||||||
|
const removeElements = (selectors, updateCache) => {
|
||||||
|
for (let i = selectors.length; i--; ) {
|
||||||
|
const selector = selectors[i];
|
||||||
|
const element = search(selector);
|
||||||
|
|
||||||
|
if (element) {
|
||||||
|
const tagName = element.tagName.toUpperCase();
|
||||||
|
|
||||||
|
if (!["BODY", "HTML"].includes(tagName)) {
|
||||||
|
element.remove();
|
||||||
|
|
||||||
|
if (updateCache) {
|
||||||
|
selectorsFromCache = [...selectorsFromCache, selector];
|
||||||
|
dispatch({
|
||||||
|
hostname: document.location.hostname,
|
||||||
|
state: { matches: [selector] },
|
||||||
|
type: "UPDATE_CACHE",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function runTasks
|
||||||
|
* @description Starts running tasks
|
||||||
|
*/
|
||||||
|
|
||||||
|
const runTasks = async () => {
|
||||||
|
if (attempts <= 20) {
|
||||||
|
fix();
|
||||||
|
removeElements(selectorsFromCache);
|
||||||
|
|
||||||
|
if (selectorsFromNetwork.length > 0) {
|
||||||
|
const selectors = selectorsFromNetwork;
|
||||||
|
|
||||||
|
if (attempts <= 5) await Promise.all(selectors.map((fn) => fn()));
|
||||||
|
if (document.readyState === "complete") attempts += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function search
|
* @function search
|
||||||
* @description Retrieves HTML element if selector exists
|
* @description Retrieves HTML element if selector exists
|
||||||
@ -80,83 +138,41 @@ const search = (selector) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function removeFromCache
|
* @description Setups classes selectors
|
||||||
* @description Removes matched elements from cache results
|
* @type {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const removeFromCache = () => {
|
const setupClasses = new Promise((resolve) => {
|
||||||
for (let i = selectorsFromCache.length; i--; ) {
|
dispatch({ type: "GET_CLASSES" }, null, ({ classes }) => {
|
||||||
const selector = selectorsFromCache[i];
|
classesFromNetwork = classes;
|
||||||
const element = search(selector);
|
resolve(true);
|
||||||
|
|
||||||
if (element) {
|
|
||||||
const tagName = element.tagName.toUpperCase();
|
|
||||||
|
|
||||||
if (!["BODY", "HTML"].includes(tagName)) element.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @function removeFromNetwork
|
|
||||||
* @description Removes matched elements from network results
|
|
||||||
*/
|
|
||||||
|
|
||||||
const removeFromNetwork = () => {
|
|
||||||
for (let i = selectorsFromNetwork.length; i--; ) {
|
|
||||||
const selector = selectorsFromNetwork[i];
|
|
||||||
const element = search(selector);
|
|
||||||
|
|
||||||
if (element) {
|
|
||||||
const tagName = element.tagName.toUpperCase();
|
|
||||||
|
|
||||||
if (!["BODY", "HTML"].includes(tagName)) {
|
|
||||||
element.remove();
|
|
||||||
dispatch({
|
|
||||||
hostname: document.location.hostname,
|
|
||||||
state: { matches: [selector] },
|
|
||||||
type: "UPDATE_CACHE",
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function runTasks
|
* @description Setups elements selectors
|
||||||
* @description Starts running tasks
|
* @type {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const runTasks = () => {
|
const setupSelectors = new Promise((resolve) => {
|
||||||
if (attempts <= 20) {
|
dispatch({ type: "GET_SELECTORS" }, null, ({ selectors }) => {
|
||||||
fix();
|
selectorsFromNetwork = chunkerize(selectors);
|
||||||
removeFromCache();
|
resolve(true);
|
||||||
if (attempts <= 5) removeFromNetwork();
|
});
|
||||||
if (document.readyState === "complete") attempts += 1;
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (attempts > 20) {
|
|
||||||
clearInterval(intervalId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description Setup extension context
|
|
||||||
*/
|
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
{ hostname: document.location.hostname, type: "GET_CACHE" },
|
{ hostname: document.location.hostname, type: "GET_CACHE" },
|
||||||
null,
|
null,
|
||||||
({ enabled, matches }) => {
|
async ({ enabled, matches }) => {
|
||||||
dispatch({ type: "ENABLE_POPUP" });
|
dispatch({ type: "ENABLE_POPUP" });
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
selectorsFromCache = matches;
|
selectorsFromCache = matches;
|
||||||
dispatch({ type: "ENABLE_ICON" });
|
dispatch({ type: "ENABLE_ICON" });
|
||||||
dispatch({ type: "GET_LIST" }, null, ({ selectors }) => {
|
await Promise.all([setupClasses, setupSelectors]);
|
||||||
selectorsFromNetwork = selectors;
|
await runTasks();
|
||||||
intervalId = setInterval(runTasks, 500);
|
setInterval(runTasks, 500);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|