01-Scripts / 2Click-Iframe-Privacy

Einfaches JavaScript um eine 2-Klick-Lösung für beliebige per IFrame eingebettete Inhalte zu aktivieren (z.B. Youtube, Google-Maps, Google Calendar etc.) - Kein Framework nötig!
https://01-scripts.github.io/2Click-Iframe-Privacy/
MIT License
40 stars 17 forks source link

Add support for Twitter embedd code #11

Open 01-Scripts opened 4 years ago

01-Scripts commented 4 years ago

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>
  &mdash; 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.

godsdog commented 3 years ago

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',