feat: edge cases support increased

This commit is contained in:
wanhose 2021-11-07 14:01:36 +01:00
parent 9da02c30f7
commit 9245d6662c
4 changed files with 39 additions and 23 deletions

View File

@ -12502,3 +12502,4 @@ epaas-consent-drawer-shell
.epaas-notavailable-banner .epaas-notavailable-banner
.cbar .cbar
.cbar-overlay .cbar-overlay
div[style="overflow: hidden; position: absolute; top: 0px; width: 379px; z-index: 991; height: 180px; margin-top: 70px; right: 0px; margin-right: 25px;"]

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Cookie Dialog Monster", "name": "Cookie Dialog Monster",
"version": "5.3.2", "version": "5.3.3",
"default_locale": "en", "default_locale": "en",
"description": "__MSG_appDesc__", "description": "__MSG_appDesc__",
"icons": { "icons": {
@ -20,7 +20,6 @@
"content_scripts": [ "content_scripts": [
{ {
"all_frames": true, "all_frames": true,
"css": ["styles/fixes.css"],
"exclude_matches": ["*://*.gfycat.com/*"], "exclude_matches": ["*://*.gfycat.com/*"],
"js": ["scripts/content.js"], "js": ["scripts/content.js"],
"matches": ["http://*/*", "https://*/*"], "matches": ["http://*/*", "https://*/*"],
@ -34,5 +33,5 @@
"storage", "storage",
"tabs" "tabs"
], ],
"web_accessible_resources": ["assets/fonts/*", "scripts/*", "styles/*"] "web_accessible_resources": ["assets/fonts/*", "scripts/popup.js", "styles/*"]
} }

View File

@ -12,11 +12,17 @@ let classes = [];
const dispatch = chrome.runtime.sendMessage; const dispatch = chrome.runtime.sendMessage;
/**
* @description Hostname
*/
const hostname = document.location.hostname;
/** /**
* @description Is consent preview page? * @description Is consent preview page?
*/ */
const isConsentPreview = document.location.host.startsWith("consent."); const isConsentPreview = hostname.startsWith("consent.");
/** /**
* @description Options provided to observer * @description Options provided to observer
@ -54,12 +60,22 @@ const clean = () => {
*/ */
const fix = () => { const fix = () => {
const automobiel = /automobielmanagement.nl/g.test(hostname);
const body = document.body; const body = document.body;
const facebook = document.getElementsByClassName("_31e")[0]; const facebook = document.getElementsByClassName("_31e")[0];
const google = document.querySelector('form[action*="consent.google"]'); const google = document.querySelector('form[action*="consent.google"]');
const html = document.documentElement; const html = document.documentElement;
const play = hostname.startsWith("play.google.");
const yahoo = document.querySelector("#consent-page"); const yahoo = document.querySelector("#consent-page");
if (automobiel && body) {
for (let i = body.childNodes.length; i--; ) {
const node = body.childNodes[i];
if (node instanceof HTMLElement)
node.style.setProperty("filter", "initial", "important");
}
}
if (body) { if (body) {
if (classes.length) body.classList.remove(...classes); if (classes.length) body.classList.remove(...classes);
body.style.setProperty("overflow-y", "initial", "important"); body.style.setProperty("overflow-y", "initial", "important");
@ -71,7 +87,8 @@ const fix = () => {
} }
if (google) { if (google) {
google.querySelector("button").click(); const submit = google.querySelector("button");
if (submit) submit.click();
} }
if (html) { if (html) {
@ -80,8 +97,14 @@ const fix = () => {
html.style.setProperty("overflow-y", "initial", "important"); html.style.setProperty("overflow-y", "initial", "important");
} }
if (play) {
const element = document.querySelector("body > div");
if (element) element.style.setProperty("z-index", "initial", "important");
}
if (yahoo) { if (yahoo) {
yahoo.querySelector('button[type="submit"]').click(); const submit = yahoo.querySelector('button[type="submit"]');
if (submit) submit.click();
} }
}; };
@ -149,10 +172,7 @@ document.addEventListener("readystatechange", () => {
* @description Setups everything and starts to observe if enabled * @description Setups everything and starts to observe if enabled
*/ */
dispatch( dispatch({ hostname, type: "GET_CACHE" }, null, async ({ enabled }) => {
{ hostname: document.location.hostname, type: "GET_CACHE" },
null,
async ({ enabled }) => {
dispatch({ type: "ENABLE_POPUP" }); dispatch({ type: "ENABLE_POPUP" });
if (enabled) { if (enabled) {
@ -162,5 +182,4 @@ dispatch(
selectors = results[1].selectors; selectors = results[1].selectors;
observer.observe(target, options); observer.observe(target, options);
} }
} });
);

View File

@ -1,3 +0,0 @@
body > * {
filter: initial !important;
}