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

Consent Management Module: TCFApi in Iframe callId fix #6634

Merged
merged 3 commits into from
Apr 28, 2021
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
5 changes: 3 additions & 2 deletions modules/consentManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
function callCmpWhileInIframe(commandName, cmpFrame, moduleCallback) {
let apiName = (cmpVersion === 2) ? '__tcfapi' : '__cmp';

let callId = Math.random() + '';
let callName = `${apiName}Call`;

/* Setup up a __cmp function to do the postMessage and stash the callback.
This function behaves (from the caller's perspective identicially to the in-frame __cmp call */
This function behaves (from the caller's perspective identicially to the in-frame __cmp call */
if (cmpVersion === 2) {
window[apiName] = function (cmd, cmpVersion, callback, arg) {
let callId = Math.random() + '';
let msg = {
[callName]: {
command: cmd,
Expand All @@ -226,6 +226,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
window[apiName](commandName, cmpVersion, moduleCallback);
} else {
window[apiName] = function (cmd, arg, callback) {
let callId = Math.random() + '';
let msg = {
[callName]: {
command: cmd,
Expand Down