In my chrome extension, I would like to store files in the browser (from background script) but not on disk, as I would like to read and erase the files quickly. Is the best solution to use blob URLs? If so, how much data can I store as blob URLs? Or should I just store the file contents in an array in the background script?
Blob is probably the best choice. They act like files- the File() constructor inherits properties from it. Arrays are memory and resource intensive for large data storage, but an Int8Array or Uint8Array would probably work if necessary, too. TypedArrays are generally faster than regular arrays. Blobs can have sizes greater than 128 MB (it varies across platforms, from 128 MB to 640 MB), which would probably fill most requirements. However, if the memory isn't available, and in other rare cases, the Blobs will be written to disk. I don't think Blobs were designed for high amounts of writing.