Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test IndexedDB 'QuotaExceededError' without filling disk?

I want to make sure my code handles the QuotaExceededError with IndexedDB properly, I'd prefer not torturing my SSD to do so.

Is there any way to set a storage limit (like to say 5 MB) in the developer tools or browser settings?

like image 225
jdw Avatar asked Oct 28 '18 01:10

jdw


3 Answers

In Chrome, you can launch the browser with --user-data-dir pointing at a smaller volume, e.g. via tmpfs.

Chrome doesn't have devtools support for such testing, but it's on the wish list.

like image 122
Joshua Bell Avatar answered Nov 03 '22 13:11

Joshua Bell


As of today you can open DevTools, go to the Application Panel and check the Simulate custom storage quota label and then provide the maximum amount of MB that can be stored by IndexedDB.

Chrome DevTools Application Panel Screeshot

like image 3
Giulio Dellorbo Avatar answered Nov 03 '22 14:11

Giulio Dellorbo


I've used a VM with a small hard drive. That's not ideal obviously, so I hope someone suggests a better answer!

like image 1
dumbmatter Avatar answered Nov 03 '22 12:11

dumbmatter