Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function capturePage() {
// TODO(jeff): Provide a custom `fetchResource(url: string): Response`
// option to prevent cors errors.
const html = await freezeDry(document)
const { url } = await files.write(
Stream.fromBuffer(Buffer.from(html, 'utf8')),
document.contentType
)
ipcRenderer.sendToHost('freeze-dry', url)
}
import freezeDry from "freeze-dry"
var capstoneExtensionId = "gcdcngjcmfebohcjojfbfkmpenlfjcfc"
freezeDry(document, { addMetadata: true }).then(html => {
const msg = { contentType: "HTML", src: window.location.href, content: html }
chrome.runtime.sendMessage(capstoneExtensionId, msg, response => {
console.log("Capstone got the HTML.")
})
})