Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added verification to check if user's optout on TrustArc CMP has been set #159

Merged
merged 2 commits into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/cmps/trustarc-top.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { click, elementExists, elementVisible } from "../rule-executors";
import { click, doEval, elementExists, elementVisible } from "../rule-executors";
import { RunContext } from "../rules";
import { getStyleElement, hideElements } from "../utils";
import AutoConsentCMPBase from "./base";
Expand Down Expand Up @@ -95,7 +95,8 @@ export default class TrustArcTop extends AutoConsentCMPBase {
}

async test() {
// TODO: find out how to test TrustArc
return true;
//Test JS variable to check the user's preference
//PrefCookie = undefined means no consent is set, PrefCookie = '0' means consent is set to required only
return await doEval("window && window.truste && window.truste.eu.bindMap.prefCookie === '0'");
}
}