Merge pull request #1117 from wanhose/v7.3.2

7.3.2
This commit is contained in:
wanhose 2024-10-05 04:04:21 +02:00 committed by GitHub
commit 8d60e48a60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 34 additions and 21 deletions

View File

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

View File

@ -40,7 +40,7 @@ if (typeof browser === 'undefined') {
* @description Actions done by the extension
* @type {Set<string>}
*/
let actions = new Set();
const actions = new Set();
/**
* @description Data object with all the necessary information
@ -237,10 +237,6 @@ function match(element, skipMatch) {
return false;
}
if (element.getAttribute(dataAttributeName)) {
return false;
}
if (seen.has(element)) {
return false;
}
@ -303,9 +299,10 @@ function fix() {
const domains = skips.domains.map((x) => (x.split('.').length < 3 ? `*${x}` : x));
for (const backdrop of backdrops) {
if (backdrop.children.length === 0 && !backdrop.hasAttribute(dataAttributeName)) {
if (backdrop.children.length === 0 && !seen.has(backdrop)) {
actions.add(new Date().getTime().toString());
backdrop.setAttribute(dataAttributeName, 'true');
seen.add(backdrop);
hide(backdrop);
}
}
@ -439,6 +436,19 @@ async function setUp(params = {}) {
}
}
/**
* @description Wait for the body to exist
* @param {void} callback
* @returns {void}
*/
async function setUpAfterWaitForBody() {
if (document.body) {
await setUp();
} else {
setTimeout(setUpAfterWaitForBody, 50);
}
}
/**
* @description Mutation Observer instance
* @type {MutationObserver}
@ -467,18 +477,6 @@ browser.runtime.onMessage.addListener(async (message) => {
}
});
/**
* @async
* @description Fix still existing elements when page loads
* @listens window#DOMContentLoaded
* @returns {void}
*/
document.addEventListener('DOMContentLoaded', async () => {
if (document.visibilityState === 'visible') {
await setUp();
}
});
/**
* @description Fix bfcache issues
* @listens window#pageshow
@ -492,7 +490,7 @@ window.addEventListener('pageshow', async (event) => {
/**
* @async
* @description Run run if the page wasn't visible yet
* @description Run if the page wasn't visited yet
* @listens window#visibilitychange
* @returns {void}
*/
@ -502,3 +500,10 @@ window.addEventListener('visibilitychange', async () => {
await setUp();
}
});
/**
* @description Run as soon as possible, if the user is in front of the page
*/
if (document.visibilityState === 'visible') {
setUpAfterWaitForBody();
}

View File

@ -21,6 +21,10 @@
{
"version": "7.3.1",
"update_link": "https://www.cookie-dialog-monster.com/releases/7.3.1-mozilla-mobile.xpi"
},
{
"version": "7.3.2",
"update_link": "https://www.cookie-dialog-monster.com/releases/7.3.2-mozilla-mobile.xpi"
}
]
}

View File

@ -53,6 +53,10 @@
{
"version": "7.3.1",
"update_link": "https://www.cookie-dialog-monster.com/releases/7.3.1.xpi"
},
{
"version": "7.3.2",
"update_link": "https://www.cookie-dialog-monster.com/releases/7.3.2.xpi"
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.