From 106846483604ceda9e34b8d857bcdca5e56c3235 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Thu, 16 Jul 2020 12:09:38 -0400 Subject: [PATCH 1/2] remove parameter field from consentManagement iframe call --- modules/consentManagement.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index 53e97006bd1..f174a1907d3 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -200,13 +200,12 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { /* 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 */ - window[apiName] = function (cmd, arg, callback) { + window[apiName] = function (cmd, callback) { let callId = Math.random() + ''; let callName = `${apiName}Call`; let msg = { [callName]: { command: cmd, - parameter: arg, callId: callId } }; @@ -220,7 +219,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { window.addEventListener('message', readPostMessageResponse, false); // call CMP - window[apiName](commandName, null, moduleCallback); + window[apiName](commandName, moduleCallback); function readPostMessageResponse(event) { let cmpDataPkgName = `${apiName}Return`; From 956b3ace92cf96a6bb6a35546bfe2cbd61ea6779 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Mon, 24 Aug 2020 14:15:44 -0400 Subject: [PATCH 2/2] update to undefined approach --- modules/consentManagement.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index f174a1907d3..1f2d2250ba4 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -200,12 +200,13 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { /* 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 */ - window[apiName] = function (cmd, callback) { + window[apiName] = function (cmd, arg, callback) { let callId = Math.random() + ''; let callName = `${apiName}Call`; let msg = { [callName]: { command: cmd, + parameter: arg, callId: callId } }; @@ -219,7 +220,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { window.addEventListener('message', readPostMessageResponse, false); // call CMP - window[apiName](commandName, moduleCallback); + window[apiName](commandName, undefined, moduleCallback); function readPostMessageResponse(event) { let cmpDataPkgName = `${apiName}Return`;