Skip to content

Instantly share code, notes, and snippets.

@r17x
Created March 4, 2019 13:58
Show Gist options
  • Select an option

  • Save r17x/0f68b95c016468d5ce3c2fae7f6a292e to your computer and use it in GitHub Desktop.

Select an option

Save r17x/0f68b95c016468d5ce3c2fae7f6a292e to your computer and use it in GitHub Desktop.
/*
 * @description Fly High With Image Handle
 * @ri7nz - Hello :D
 
 */

const FileOrBlob = new File([
  ArrayBuffer 
  || ArrayBufferView
  || Blob 
  || DOMString
])  || new Blob([ArrayBuffer])

// create blob url
// Its Work for Main.js
// not Work for WebWorker
window.URL.createObjectURL(FileOrBlob)

// Its Work for WebWorker
URL.createObjectURL(FileOrBlob)
// output will be something like: blob:d3958f5c-0777-0845-9dcf-2cb28783acaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment