From 73a88a3b5fb2478c9c3f0fec0467346737ce521b Mon Sep 17 00:00:00 2001 From: Reinout Stevens Date: Wed, 2 Dec 2020 12:20:41 +0100 Subject: [PATCH] update comment --- modules/consentManagementUsp.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/consentManagementUsp.js b/modules/consentManagementUsp.js index bfcb1372c02..cba9c2758d0 100644 --- a/modules/consentManagementUsp.js +++ b/modules/consentManagementUsp.js @@ -57,6 +57,7 @@ function lookupUspConsent(uspSuccess, uspError, hookConfig) { break; } } catch (e) {} + try { if (f.frames['__uspapiLocator']) { uspapiFrame = f; @@ -106,10 +107,10 @@ function lookupUspConsent(uspSuccess, uspError, hookConfig) { // to collect the user's consent choices represented as a string (via getUSPData) // the following code also determines where the USPAPI is located and uses the proper workflow to communicate with it: - // - use the USPAPI locator code to see if USP's located in the current window or an ancestor window. This works in friendly or cross domain iframes + // - use the USPAPI locator code to see if USP's located in the current window or an ancestor window. + // - else assume prebid is in an iframe, and use the locator to see if the CMP is located in a higher parent window. This works in cross domain iframes. // - if USPAPI is not found, the iframe function will call the uspError exit callback to abort the rest of the USPAPI workflow - // - try to call the __uspapi() function directly, otherwise use the postMessage() api - // find the CMP frame/window + if (utils.isFn(uspapiFunction)) { utils.logInfo('Detected USP CMP is directly accessible, calling it now...'); uspapiFunction(