commit
9a735beaeb
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Cookie Dialog Monster",
|
"name": "Cookie Dialog Monster",
|
||||||
"version": "6.2.3",
|
"version": "6.3.0",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_appDesc__",
|
"description": "__MSG_appDesc__",
|
||||||
"icons": {
|
"icons": {
|
||||||
@ -21,11 +21,9 @@
|
|||||||
{
|
{
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
"exclude_matches": [
|
"exclude_matches": [
|
||||||
"*://*.gfycat.com/*",
|
"*://*.googleapis.com/embed/*",
|
||||||
"*://*.mediathekviewweb.de/*",
|
"*://*.sharepoint.com/*",
|
||||||
"*://*.rundschau-online.de/*",
|
"*://*.youtube.com/embed/*"
|
||||||
"*://*.youtube.com/embed/*",
|
|
||||||
"*://drive.google.com/*"
|
|
||||||
],
|
],
|
||||||
"js": ["scripts/content.js", "scripts/dialog.js"],
|
"js": ["scripts/content.js", "scripts/dialog.js"],
|
||||||
"matches": ["http://*/*", "https://*/*"],
|
"matches": ["http://*/*", "https://*/*"],
|
||||||
|
@ -107,9 +107,6 @@ chrome.runtime.onMessage.addListener((message, sender, callback) => {
|
|||||||
case 'GET_TAB':
|
case 'GET_TAB':
|
||||||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => callback(tabs[0]));
|
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => callback(tabs[0]));
|
||||||
return true;
|
return true;
|
||||||
case 'INSERT_CONTENT_CSS':
|
|
||||||
if (isPage && tabId) script.insertCSS({ files: ['styles/content.css'], target: { tabId } });
|
|
||||||
break;
|
|
||||||
case 'INSERT_DIALOG_CSS':
|
case 'INSERT_DIALOG_CSS':
|
||||||
if (isPage && tabId) script.insertCSS({ files: ['styles/dialog.css'], target: { tabId } });
|
if (isPage && tabId) script.insertCSS({ files: ['styles/dialog.css'], target: { tabId } });
|
||||||
break;
|
break;
|
||||||
|
@ -53,12 +53,22 @@ let state = { enabled: true };
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const clean = (nodes, skipMatch) => {
|
const clean = (nodes, skipMatch) => {
|
||||||
const targets = nodes.filter((node) => match(node, skipMatch));
|
for (let i = 0; i < nodes.length; i++) {
|
||||||
|
const node = nodes[i];
|
||||||
|
|
||||||
targets.forEach((node) => {
|
if (match(node, skipMatch)) {
|
||||||
node.remove();
|
const observer = new MutationObserver(() => {
|
||||||
elementCount += 1;
|
node.style.setProperty('display', 'none', 'important');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!node.hasAttribute('data-cookie-dialog-monster')) {
|
||||||
|
elementCount += 1;
|
||||||
|
node.setAttribute('data-cookie-dialog-monster', 'true');
|
||||||
|
node.style.setProperty('display', 'none', 'important');
|
||||||
|
observer.observe(node, { attributes: true, attributeFilter: ['style'] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,9 +118,11 @@ const match = (node, skipMatch) => {
|
|||||||
if (node instanceof HTMLElement) {
|
if (node instanceof HTMLElement) {
|
||||||
const style = window.getComputedStyle(node);
|
const style = window.getComputedStyle(node);
|
||||||
const skipIsInViewport =
|
const skipIsInViewport =
|
||||||
|
(style.animationName !== 'none' && style.animationPlayState === 'running') ||
|
||||||
style.display === 'none' ||
|
style.display === 'none' ||
|
||||||
style.height === '0px' ||
|
style.height === '0px' ||
|
||||||
style.opacity === '0' ||
|
style.opacity === '0' ||
|
||||||
|
style.transitionProperty !== 'none' ||
|
||||||
style.visibility === 'hidden';
|
style.visibility === 'hidden';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -172,9 +184,7 @@ const fix = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skips.includes(hostname)) {
|
if (!skips.some((skip) => skip.includes(hostname))) {
|
||||||
dispatch({ type: 'INSERT_CONTENT_CSS' });
|
|
||||||
|
|
||||||
for (const item of [document.body, document.documentElement]) {
|
for (const item of [document.body, document.documentElement]) {
|
||||||
item?.classList.remove(...(data?.classes ?? []));
|
item?.classList.remove(...(data?.classes ?? []));
|
||||||
item?.style.setProperty('position', 'initial', 'important');
|
item?.style.setProperty('position', 'initial', 'important');
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
*,
|
|
||||||
*:before,
|
|
||||||
*:after {
|
|
||||||
animation: none !important;
|
|
||||||
/* transform: none !important; */
|
|
||||||
transition-property: none !important;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user