Merge pull request #56 from wanhose/v6.0.4

6.0.4
This commit is contained in:
wanhose 2022-08-18 11:12:28 +02:00 committed by GitHub
commit 8ed56bd5a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "Cookie Dialog Monster", "name": "Cookie Dialog Monster",
"version": "6.0.3", "version": "6.0.4",
"default_locale": "en", "default_locale": "en",
"description": "__MSG_appDesc__", "description": "__MSG_appDesc__",
"icons": { "icons": {

View File

@ -53,7 +53,7 @@ let state = { enabled: true };
*/ */
const clean = (nodes, skipMatch) => { const clean = (nodes, skipMatch) => {
const targets = nodes.filter((node) => skipMatch || match(node)); const targets = nodes.filter((node) => match(node, skipMatch));
targets.forEach((node) => { targets.forEach((node) => {
node.remove(); node.remove();
@ -81,10 +81,11 @@ const forceClean = () => {
/** /**
* @description Matches if node element is removable * @description Matches if node element is removable
* @param {Element} node * @param {Element} node
* @param {boolean?} skipMatch
* @returns {boolean} * @returns {boolean}
*/ */
const match = (node) => { const match = (node, skipMatch) => {
if (!(node instanceof HTMLElement)) return false; if (!(node instanceof HTMLElement)) return false;
const rect = node.getBoundingClientRect(); const rect = node.getBoundingClientRect();
@ -96,7 +97,7 @@ const match = (node) => {
(isFullscreen || isVisible) && (isFullscreen || isVisible) &&
(node.offsetParent || window.getComputedStyle(node).position === 'fixed') && (node.offsetParent || window.getComputedStyle(node).position === 'fixed') &&
node.parentElement && node.parentElement &&
node.matches(data?.elements ?? []) (skipMatch || node.matches(data?.elements ?? []))
); );
}; };