Closed lloydzhou closed 1 month ago
using base64 string to save image content to localstorage, get error: QuotaExceededError
QuotaExceededError
add new scheme: indexdb://{file_name} to read and write file in indexdb.
indexdb://{file_name}
using CacheStorage to store image
CacheStorage
add new scheme: indexdb://{file_name} to read and write file in indexed db
serviceWorker
img
https://caniuse.com/?search=IndexedDB
https://caniuse.com/?search=cachestorage
https://github.com/debingfeng/blog/blob/master/docs/javascript/practise/%E4%BD%BF%E7%94%A8IndexDB%E5%AD%98%E5%82%A8%E5%9B%BE%E5%83%8F%E5%92%8C%E6%96%87%E4%BB%B6.md
https://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/
不知道有没有用的npm包 https://www.npmjs.com/search?q=indexdb%20file
🥰 Feature Description
2393 #4574 #3994 #2433 #5002 #5015
using base64 string to save image content to localstorage, get error:
QuotaExceededError
add new scheme:indexdb://{file_name}
to read and write file in indexdb.using
CacheStorage
to store image🧐 Proposed Solution
add new scheme:indexdb://{file_name}
to read and write file in indexed dbusing CacheStorage to store image
serviceWorker
: save inCacheStorage
and return cache file urlimg
show image content, thenserviceWorker
get fromCacheStorage
📝 Additional Information
https://caniuse.com/?search=IndexedDB
https://caniuse.com/?search=cachestorage