Uncaught error when localstorage not available
When trying to open a box in a browser that block localstorage, there is an uncaught error and the Box.openBox method does not throw an error.
In some browsers, localStorage is not available (such as brave browser on cross-domain embedded sites, chrome when blocking third party cookies...)
Accessing the property window.localStorage throws an error (even just checking window.localStorage !== undefined)
Error thrown:

@pakokrew Currently 3Box requires localstorage and IndexedDB in order to store local state. Unfortunately there is no easy way around this.
brave browser on cross-domain embedded sites
What does this mean exactly?
@oed I know you need localStorage.
What I meant is that in such cases, the Box.openBox() method does not throw, so it's impossible to know if there is a problem.
It would be better that you catch this Uncaught exception and throw something to us, so we can display an error message to our users.
What does this mean exactly?
Inside iframes, brave disable the use of localStorage. The result is that, instead of having window.localStorage === undefined, just accessing the .localStorage throws an error. This behaviour is not implemented in most of the storage npm packages.
You can find an example here : https://mooni-widget-example.now.sh/ Open it in brave, then check the console (this example error is not from 3Box but walletconnect, same issue).
Thanks @pakokrew That's a good idea to throw an error if that's the case! Will put this in our backlog.
Do you know why brave disables localstorage in iframes? Is other storage methods such as IndexedDB available?
That's part of privacy protecting strategy. They consider them like cross-domain/third party cookies. I don't think other types of storage will be supported. Apple's Webkit will pose a lot of problems soon also, and chrome may follow.
If you disable shields on brave, it works.
Hey @pakokrew, an update: We are tracking improvements to this here #772
Until that is implemented I suggest you can manually check if localstorage is available before you call openBox.