@adv-ui/boros-tcf-stub
Version:
Adevinta GDPR - Transparency and Consent Framework - Stub for Boros TCF
29 lines (24 loc) • 726 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.registerTcfApiLocator = void 0;
var _waitUntil = require("./waitUntil");
var registerTcfApiLocator = function registerTcfApiLocator() {
if (window.frames[TCF_API_LOCATOR]) {
return false;
}
(0, _waitUntil.waitUntil)({
condition: function condition() {
return !!window.document.body;
}
}).then(function () {
var iframe = window.document.createElement('iframe');
iframe.style.cssText = 'display:none';
iframe.name = TCF_API_LOCATOR;
window.document.body.appendChild(iframe);
});
return true;
};
exports.registerTcfApiLocator = registerTcfApiLocator;
var TCF_API_LOCATOR = '__tcfapiLocator';