From 94718b82f0ccd2e9dfbe7bf3972dca29596084f2 Mon Sep 17 00:00:00 2001 From: wanhose Date: Tue, 9 Nov 2021 20:34:21 +0100 Subject: [PATCH 1/2] fix(scripts): a lot of video issues --- scripts/content.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/content.js b/scripts/content.js index 6879f90..0390def 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -79,6 +79,7 @@ const fix = () => { const automobiel = /automobielmanagement.nl/g.test(hostname); const body = document.body; const facebook = document.getElementsByClassName("_31e")[0]; + const frame = document.location.ancestorOrigins.length; const google = document.querySelector('form[action*="consent.google"]'); const html = document.documentElement; const play = hostname.startsWith("play.google."); @@ -95,9 +96,12 @@ const fix = () => { } if (body) { - if (classes.length) body.classList.remove(...classes); - body.style.setProperty("overflow-y", "initial", "important"); - body.style.setProperty("position", "initial", "important"); + body.classList.remove(...classes); + + if (!frame) { + body.style.setProperty("overflow-y", "initial", "important"); + body.style.setProperty("position", "initial", "important"); + } } if (facebook) { @@ -113,9 +117,12 @@ const fix = () => { } if (html) { - if (classes.length) html.classList.remove(...classes); - html.style.setProperty("position", "initial", "important"); - html.style.setProperty("overflow-y", "initial", "important"); + html.classList.remove(...classes); + + if (!frame) { + html.style.setProperty("position", "initial", "important"); + html.style.setProperty("overflow-y", "initial", "important"); + } } if (play) { @@ -181,14 +188,13 @@ const setupSelectors = () => */ document.addEventListener("readystatechange", () => { - if (document.readyState === "complete") { - fix(); - - if (!isConsentPreview) { + dispatch({ hostname, type: "GET_CACHE" }, null, async ({ enabled }) => { + if (document.readyState === "complete" && enabled && !isConsentPreview) { + fix(); clean(); setTimeout(clean, 2000); } - } + }); }); /** From 0fa751ab80d5151cac00a080cd71a3091c706292 Mon Sep 17 00:00:00 2001 From: wanhose Date: Tue, 9 Nov 2021 20:34:29 +0100 Subject: [PATCH 2/2] chore(manifest): upgrade version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d4f1816..5a4f655 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Cookie Dialog Monster", - "version": "5.4.0", + "version": "5.4.1", "default_locale": "en", "description": "__MSG_appDesc__", "icons": {