Advanced Cookie Consent: Embed code is not activated after insert

Kirby

Well-known member
Affected version
2.2.12
XF.CookieConsentForm method load

Code:
this.$target[0].replaceWith(this.$embedHtml[0].content.cloneNode(true));

This inserts the actual embed code into DOM but does not call activate on it, eg. handlers do not get called (if there are any, like for Twitter).

Changing this to smth. like
Code:
let clone = this.$embedHtml[0].content.cloneNode(true);
XF.activate(clone);
this.$target[0].replaceWith(clone);

seems to fix this.
 
Last edited:
Top Bottom