Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

350 B
Raw Blame
import 'iframe-resizer/js/iframeResizer.contentWindow'

window.iFrameResizer = {
  onMessage: function (msg) {
    if (msg.type === 'load-custom-styles') {
      addCustomStyles(msg.opts)
    }
  }
}

function addCustomStyles(opts) {
  var style = document.createElement('style')
  style.innerHTML = opts.styles

  document.head.appendChild(style)
}