Sha256: 073572d9f0e15d24752d61c66fd4faadb12b2a674721523d73c21f49791ebeda
Contents?: true
Size: 389 Bytes
Versions: 19
Compression:
Stored size: 389 Bytes
Contents
async function fetchHTML(url, selector) { const response = await fetch(url || window.document.location); const html = await response.text(); const doc = new DOMParser().parseFromString(html, "text/html"); return { ok: response.ok, fragment: selector ? doc.querySelector(selector).outerHTML : null, title: doc.title, response, doc, }; } export { fetchHTML };
Version data entries
19 entries across 19 versions & 1 rubygems