How to use the blob-util.dataURLToBlob function in blob-util

To help you get started, we’ve selected a few blob-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WebMemex / webmemex-extension / src / page-capture / background / make-screenshot.js View on Github external
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
}
github WorldBrain / Memex / src / bookmarks / background / addition.js View on Github external
async function getAttachments(pageData) {
    const favIconBlob = await dataURLToBlob(pageData.favIconURI)

    return {
        'fav-icon-blob': {
            content_type: favIconBlob.type,
            data: favIconBlob,
        },
    }
}