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 snapNow({ tabId }) {
const tab = await browser.tabs.get(tabId)
const imageDataUrl = await browser.tabs.captureVisibleTab(
tab.windowId,
{ format: 'png' }
)
const imageBlob = await dataURLToBlob(imageDataUrl)
return imageBlob
}
async function getAttachments(pageData) {
const favIconBlob = await dataURLToBlob(pageData.favIconURI)
return {
'fav-icon-blob': {
content_type: favIconBlob.type,
data: favIconBlob,
},
}
}