2Click-Iframe-Privacy
2Click-Iframe-Privacy copied to clipboard
Add support for Twitter embedd code
Embedding code from twitter looks that way:
<blockquote class="twitter-tweet">
<p lang="en" dir="ltr">Finding new physics will require a new particle collider <a href="https://t.co/PwLTfKnVT7">https://t.co/PwLTfKnVT7</a></p>
— Hacker News (@newsycombinator) <a href="https://twitter.com/newsycombinator/status/1259453443137298433?ref_src=twsrc%5Etfw">May 10, 2020</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Basically the script tag must be handled accoringly to iframes.
I also needed an external script to load after the iframe is loaded. I solved it with the callback:
function init_script() {
$( '<script defer src="https://www.domain.com/js/resizecustomersitescroll.min.js"></script>' ).insertAfter( '#iframeId' );
}
callback: 'init_script',