var newWindow = window.open(); var content = $(frame.contentWindow.document).find('html')[0].outerHTML;