You can do response.text() in an <iframe> (with visibility: hidden if you want). Then you can manage a new document with all the standard features:
<!DOCTYPE html> <html> <head> <title>This is the page title</title> <meta charset="UTF-8"> <meta name="description" content="Free Web Help"> <meta name="keywords" content="HTML,CSS,XML,JavaScript"> <meta charset="utf-8"> </head> <body> </body> <script> var img = new Image(); img.src = "http://cdn.sstatic.net/stackoverflow/img/ apple-touch-icon@2.png "; document.body.appendChild(img); fetch("so.html") .then(function(response) { return (response.text()); }) .then(function(responseText) { </script> </html>
To try it yourself, you can save this code as so.html and access it on your local web server, or you can check here .
source share