-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unblock scrolling in sourcepoint * Fix aws rule * Run popup detection steps sequentially * Handle multiple CMPs on the same page (opt-out is still executed for only one of them) * Expand the klaro rule * Fix cookieconsent rule * Add a bunch of detection rules (no opt-out yet) * some test fixes * Indicate which CMP was found in the extension * Add opt-out rules for complianz, cookie information, primebox, tarteaucitron and wp-cookie-notice * Conditional JSON rules * Add opt-out rules for Moove * Add opt-out rules for Termly * Fix termly and tests for Moove * Add opt-out rules for jquery.cookiebar plugin * Opt-out rules for UK Cookie Consent * Add rules for eu cookie law and Mediavine * Add rules for EZoic * Test fixes * remove outdated rule * Add rules for DSGVO Tools * Sort out different complianz flavors * Stabilize mediavine opt-in * Fix rule for vodafone * Fix complianz test * Add iubenda * Limit conditionals to visible and exists rules * Fix sourcepoint rule * Add rules for usercentrics-banner * clarify the "if" docs
- Loading branch information
Showing
62 changed files
with
731 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { click, doEval, elementExists, elementVisible, waitForElement } from "../rule-executors"; | ||
import AutoConsentCMPBase from "./base"; | ||
|
||
export default class Klaro extends AutoConsentCMPBase { | ||
|
||
prehideSelectors = [".klaro"] | ||
settingsOpen = false; | ||
|
||
constructor() { | ||
super("Klaro"); | ||
} | ||
|
||
get hasSelfTest(): boolean { | ||
return true; | ||
} | ||
|
||
get isIntermediate(): boolean { | ||
return false; | ||
} | ||
|
||
async detectCmp() { | ||
if (elementExists('.klaro > .cookie-modal')) { | ||
this.settingsOpen = true; | ||
return true; | ||
} | ||
return elementExists(".klaro > .cookie-notice"); | ||
} | ||
|
||
async detectPopup() { | ||
return elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", 'any'); | ||
} | ||
|
||
async optOut() { | ||
if (click('.klaro .cn-decline')) { | ||
return true; | ||
} | ||
|
||
if (!this.settingsOpen) { | ||
click('.klaro .cn-learn-more'); | ||
await waitForElement('.klaro > .cookie-modal', 2000); | ||
this.settingsOpen = true; | ||
} | ||
|
||
if (click('.klaro .cn-decline')) { | ||
return true; | ||
} | ||
|
||
click('.cm-purpose:not(.cm-toggle-all) > input:not(.half-checked)', true); | ||
return click('.cm-btn-accept'); | ||
} | ||
|
||
async optIn() { | ||
if (click('.klaro .cm-btn-accept-all')) { | ||
return true; | ||
} | ||
if (this.settingsOpen) { | ||
click('.cm-purpose:not(.cm-toggle-all) > input.half-checked', true); | ||
return click('.cm-btn-accept'); | ||
} | ||
return click('.klaro .cookie-notice .cm-btn-success'); | ||
} | ||
|
||
async test() { | ||
return await doEval('klaro.getManager().config.services.every(c => c.required || !klaro.getManager().consents[c.name])'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.