Skip to content

Instantly share code, notes, and snippets.

View leabs's full-sized avatar
🎯
Currently working on a project fulltime

Steven Leabo leabs

🎯
Currently working on a project fulltime
View GitHub Profile
(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);