@duckduckgo/autoconsent
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -704,3 +704,13 @@ 'use strict'; | ||
elem.forEach((e, i) => { | ||
results[i] = e.offsetParent !== null || window.getComputedStyle(e).display !== "none"; // TODO: handle visibility and z-index? | ||
// check for display: none | ||
results[i] = false; | ||
if (e.offsetParent !== null) { | ||
results[i] = true; | ||
} | ||
else { | ||
const css = window.getComputedStyle(e); | ||
if (css.position === 'fixed' && css.display !== "none") { // fixed elements may be visible even if the parent is not | ||
results[i] = true; | ||
} | ||
} | ||
}); | ||
@@ -1194,2 +1204,4 @@ debug && console.log("[visible?]", message.selector, elem, results); | ||
await success(tab.waitForThenClick(".save-preference-btn-handler,.js-consent-save", 1000)); | ||
// popup doesn't disappear immediately | ||
await waitFor(async () => !(await tab.elementsAreVisible("#onetrust-banner-sdk")), 10, 500); | ||
return true; | ||
@@ -1196,0 +1208,0 @@ } |
@@ -700,3 +700,13 @@ const enableLogs = false; // change this to enable debug logs | ||
elem.forEach((e, i) => { | ||
results[i] = e.offsetParent !== null || window.getComputedStyle(e).display !== "none"; // TODO: handle visibility and z-index? | ||
// check for display: none | ||
results[i] = false; | ||
if (e.offsetParent !== null) { | ||
results[i] = true; | ||
} | ||
else { | ||
const css = window.getComputedStyle(e); | ||
if (css.position === 'fixed' && css.display !== "none") { // fixed elements may be visible even if the parent is not | ||
results[i] = true; | ||
} | ||
} | ||
}); | ||
@@ -1190,2 +1200,4 @@ debug && console.log("[visible?]", message.selector, elem, results); | ||
await success(tab.waitForThenClick(".save-preference-btn-handler,.js-consent-save", 1000)); | ||
// popup doesn't disappear immediately | ||
await waitFor(async () => !(await tab.elementsAreVisible("#onetrust-banner-sdk")), 10, 500); | ||
return true; | ||
@@ -1192,0 +1204,0 @@ } |
@@ -959,2 +959,4 @@ 'use strict'; | ||
await success(tab.waitForThenClick(".save-preference-btn-handler,.js-consent-save", 1000)); | ||
// popup doesn't disappear immediately | ||
await waitFor(async () => !(await tab.elementsAreVisible("#onetrust-banner-sdk")), 10, 500); | ||
return true; | ||
@@ -961,0 +963,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import AutoConsentBase, { success } from "./base"; | ||
import AutoConsentBase, { success, waitFor } from "./base"; | ||
export default class Onetrust extends AutoConsentBase { | ||
@@ -24,2 +24,4 @@ constructor() { | ||
await success(tab.waitForThenClick(".save-preference-btn-handler,.js-consent-save", 1000)); | ||
// popup doesn't disappear immediately | ||
await waitFor(async () => !(await tab.elementsAreVisible("#onetrust-banner-sdk")), 10, 500); | ||
return true; | ||
@@ -26,0 +28,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import AutoConsentBase, { success } from "./base"; | ||
import AutoConsentBase, { success, waitFor } from "./base"; | ||
import { TabActor } from "../types"; | ||
@@ -31,2 +31,8 @@ | ||
await success(tab.waitForThenClick(".save-preference-btn-handler,.js-consent-save", 1000)); | ||
// popup doesn't disappear immediately | ||
await waitFor( | ||
async () => !(await tab.elementsAreVisible("#onetrust-banner-sdk")), | ||
10, | ||
500 | ||
); | ||
return true; | ||
@@ -33,0 +39,0 @@ } |
@@ -27,3 +27,13 @@ import { matches, executeAction } from "./consentomatic/index"; | ||
elem.forEach((e, i) => { | ||
results[i] = e.offsetParent !== null || window.getComputedStyle(e).display !== "none"; // TODO: handle visibility and z-index? | ||
// check for display: none | ||
results[i] = false; | ||
if (e.offsetParent !== null) { | ||
results[i] = true; | ||
} | ||
else { | ||
const css = window.getComputedStyle(e); | ||
if (css.position === 'fixed' && css.display !== "none") { // fixed elements may be visible even if the parent is not | ||
results[i] = true; | ||
} | ||
} | ||
}); | ||
@@ -30,0 +40,0 @@ debug && console.log("[visible?]", message.selector, elem, results); |
@@ -27,3 +27,12 @@ import { matches, executeAction } from "./consentomatic/index"; | ||
elem.forEach((e, i) => { | ||
results[i] = e.offsetParent !== null || window.getComputedStyle(e).display !== "none"; // TODO: handle visibility and z-index? | ||
// check for display: none | ||
results[i] = false; | ||
if (e.offsetParent !== null) { | ||
results[i] = true; | ||
} else { | ||
const css = window.getComputedStyle(e); | ||
if (css.position === 'fixed' && css.display !== "none") { // fixed elements may be visible even if the parent is not | ||
results[i] = true; | ||
} | ||
} | ||
}); | ||
@@ -30,0 +39,0 @@ debug && console.log("[visible?]", message.selector, elem, results); |
{ | ||
"name": "@duckduckgo/autoconsent", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/autoconsent.cjs.js", |
{ | ||
"name": "aws.amazon.com", | ||
"prehideSelectors": ["#awsccc-cb-content", "#awsccc-cs-container-inner"], | ||
"prehideSelectors": ["#awsccc-cb-content", "#awsccc-cs-container", "#awsccc-cs-modalOverlay", "#awsccc-cs-container-inner"], | ||
"detectCmp": [{ "exists": "#awsccc-cb-content" }], | ||
@@ -5,0 +5,0 @@ "detectPopup": [{ "visible": "#awsccc-cb-content" }], |
@@ -5,3 +5,3 @@ { | ||
"detectCmp": [{ "exists": ".bpa-cookie-banner" }], | ||
"detectPopup": [{ "visible": ".bpa-module-full-hero" }], | ||
"detectPopup": [{ "visible": ".bpa-cookie-banner .bpa-module-full-hero" }], | ||
"optIn": [{ "click": ".bpa-accept-all-button" }], | ||
@@ -8,0 +8,0 @@ "optOut": [ |
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
434050
12323
2