• Resolved arypneta

    (@arypneta)


    We have some scripts that run on the load of certain iframes to perform various tasks (mainly iframe resizing). Right now they initialize with the jQuery ready function or the standard DOMContentLoaded event. Without embed privacy, the iframes are loaded when the page loads and the scripts trigger to resize as expected.

    However, with Embed Privacy, the iframes don’t actually exist unless the user has previously approved the content or until they click to approve the content on the page. When they click to approve content, that then loads the iframe, but because the page is already ready/loaded, it doesn’t run the other scripts again (like iframe resizing).

    I may be overlooking something obvious, but do you have any suggestions on how to deal with that? My initial thought was that if Embed Privacy has some kind of event for “content approved/loaded” I could add that to our scripts and re-call the iframe loading scripts when the iframe is actually loaded.

    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matthias Kittsteiner

    (@kittmedia)

    Hi @arypneta,

    currently, Embed Privacy does not provide a custom event to listen to on activation. As a workaround, you can add a click event listener to every .embed-privacy-overlay, ideally set a short timeout of a few milliseconds to make sure the click event of Embed Privacy has already been processed, and then query for the iframe inside and execute your logic.

    Alternatively, you can use a MutationObserver and check for changes there.

    Hope that helps.

    Best regards,
    Matthias

    Thread Starter arypneta

    (@arypneta)

    Thanks for the suggestions, Matthias! I think the click listener will probably do what we want, so that’s helpful to know the right class name to target.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.