Duplicate of #397, this time with code.
I created https://github.com/andi5/history/tree/session-storage-not-available , but I do not know how to create a pull request against a not-yet-existing v3.x branch.
Similar to #215, but the try-catch-blocks added there does not cover all the cases.
Reproduction:
use google Chrome (v55.0.2883.87 atm)
block cookies for all websites
visit any page that uses DOMStateStorage.(read|save)State from history v3.2.1
=> Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
"sessionStorage" in window would simply return true, whereas using window.sessionStorage throws the exception from above. The code does so without try-catch.
What's stopping you from upgrading to 4.x? I'd rather not maintain a 3.x branch if we can avoid it. AFAICT, you're the first person who's asked for it.
We are not using history directly, but rather through dependencies:
These are not dependencies we would like to reimplement or experiment with. Instead we are waiting for them to update or hope that history 3.x will be maintained in the meanwhile.
I also faced this issue. Safari and Opera also throw an exception if cookies are disabled.
It's a bit rare situation when the user disables cookies and usually, developers don't check their code in browsers with disabled cookies.
As far as I know it could be fixed by replacing if (window.sessionStorage) with if ('sessionStorage' in window') or wrapping the whole condition in try/catch block.
Same here. Can we help out in any way to provide a fix for history 3.x.x?
We're depending on react-router and react-router-scroll which in turn depends on history 3.x.x.
FWIW, we're getting thousands of those errors, because react-router-scroll triggers a saveState on every scroll event (I think).

I'm not supporting version 3 any more. Please send a PR if you'd like to see this fixed.
I've created #439 with fix for this error
Most helpful comment
We are not using history directly, but rather through dependencies:
These are not dependencies we would like to reimplement or experiment with. Instead we are waiting for them to update or hope that history 3.x will be maintained in the meanwhile.