dependencies/js/iframify.js
function iframify (node, options) {
    options = getOptions(options);

    var iframe = document.createElement('iframe');
    var html = getIframeContentForNode(node, options);
    iframe.srcdoc = html;

    if (!('srcdoc' in iframe)) {
      console.log(
        'Your browser does not support the `srcdoc` attribute on elements.' +
        'Therefore, it is not possible to wrap this node with an iframe due' +
        'to CORS policy.'
      );

      return null;
    }

    node.parentNode.replaceChild(iframe, node);

    setTimeout(function () {
      var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
      iframe.height = getDocumentHeight(iframeDocument);
    }, options.sizingTimeout);

    return iframe;
  }
function iframify (node, options) {
    options = getOptions(options);

    var iframe = document.createElement('iframe');
    var html = getIframeContentForNode(node, options);
    iframe.srcdoc = html;

    if (!('srcdoc' in iframe)) {
      console.log(
        'Your browser does not support the `srcdoc` attribute on elements.' +
        'Therefore, it is not possible to wrap this node with an iframe due' +
        'to CORS policy.'
      );

      return null;
    }

    node.parentNode.replaceChild(iframe, node);

    setTimeout(function () {
      var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
      iframe.height = getDocumentHeight(iframeDocument);
    }, options.sizingTimeout);

    return iframe;
  }
function iframify ( node , options ) { options = getOptions ( options ) ; var iframe = document . createElement ( 'iframe' ) ; var html = getIframeContentForNode ( node , options ) ; iframe . srcdoc = html ; if ( ! ( 'srcdoc' in iframe ) ) { console . log ( 'Your browser does not support the `srcdoc` attribute on elements.' + 'Therefore, it is not possible to wrap this node with an iframe due' + 'to CORS policy.' ) ; return null ; } node . parentNode . replaceChild ( iframe , node ) ; setTimeout ( function ( ) { var iframeDocument = iframe . contentDocument || iframe . contentWindow . document ; iframe . height = getDocumentHeight ( iframeDocument ) ; } , options . sizingTimeout ) ; return iframe ; }
Transform a collection of nodes into an iframe version of themselves
including all the styles they need to perform correctly.

@param  {HTMLElement} nodes
@param  {Object} options
@return undefined
Transform a collection of nodes into an iframe version of themselves including all the styles they need to perform correctly .