And we highly value Tor Browser's Anonymity-first development.
But disabling(removing?) such API will break Javascript applications.
Instead of removing localStorage/sessionStorage code, why not:
a) Treat all "localStorage"(long term) as "sessionStorage"(short term).
b) Enable "sessionStorage" by default, like Mozilla Firefox provides.
c) When the user close the tab or click "New Identity", clear local|sessionStorage.
I just took a clean, new Tor Browser 7.5.4 and performed your steps to reproduce the problem. And I get the expected result 0 and not the error. So, this is working on my Linux box. On what OS have you been testing? Did you make any modifications to Tor Browser? If so, which?
Trac: Sponsor: N/AtoN/A Status: new to needs_information