This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async function downloadCompleteHTML() { | |
// Helper function to fetch content of external files (CSS, JS, images) | |
async function fetchResource(url, isBinary = false) { | |
try { | |
const response = await fetch(url); | |
if (isBinary) { | |
const blob = await response.blob(); | |
return new Promise((resolve, reject) => { | |
const reader = new FileReader(); | |
reader.onloadend = () => resolve(reader.result); |