storeFrame = function (iframe) {
    var script=document.createElement("script");
    script.setAttribute("type", "text/html");
    script.setAttribute("id", iframe.getAttribute("src").replace(/.*templates[^\/]*\//,'templates/'));
    script.innerHTML = iframe.contentWindow.document.body.innerHTML;
    iframe.parentNode.removeChild(iframe);
    document.body.appendChild(script);
  }
Load the iframe content as a <script type="text/html" id={iframe-src}>{iframe-content}</script>
The content can later be accessed by getting the script (through getElementById for instance) and reading innerHTML
@param  {HTMLElement} iframe