4 var ready = function (loaded) {
5 if (['interactive', 'complete'].indexOf(document.readyState) !== -1) {
8 document.addEventListener('DOMContentLoaded', loaded)
15 window.addEventListener('message', function (e) {
16 var data = e.data || {}
18 if (data.type !== 'setHeightPleromaEmbed' || !iframes[data.id]) {
22 iframes[data.id].height = data.height
25 [].forEach.call(document.querySelectorAll('iframe.pleroma-embed'), function (iframe) {
26 iframe.scrolling = 'no'
27 iframe.style.overflow = 'hidden'
31 var id = iframes.length - 1
33 iframe.onload = function () {
34 iframe.contentWindow.postMessage({
35 type: 'setHeightPleromaEmbed',