tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
177 stars 41 forks source link

Add troubleshooting information to the 'no valid storage adapters found' error message #246

Closed BawdyInkSlinger closed 1 year ago

BawdyInkSlinger commented 1 year ago

Is your feature request related to a problem? 'no valid storage adapters found' is alerted when the browser can't save to storage. In certain situations, and might be possible to provide troubleshooting information.

Describe the solution you'd like. This alert could provide more information like, "enable third-party cookies," or, "try playing on a non-incognito tab," etc.

Describe alternatives you've considered. Monkey patching the twine code to provide this information. That may not work because this code may load before anything I could monkey patch.

Additional context. See https://www.newgrounds.com/bbs/topic/1525870 for additional information and (what I believe is) the cause of the issue.

For full context, view the conversation on discord: https://discord.com/channels/389867840406159362/389868418855075840/1123371260848648325

BawdyInkSlinger commented 1 year ago

See https://stackoverflow.com/a/75075731/13669212 for more info about this 3rd-party cookies setting.

tmedwards commented 1 year ago

You're not telling me anything I don't already know about this snafu.

All browsers that I know of lump Web Storage into the third-party cookie setting. It's stupid, but there's nothing anyone can do about it—aside from the browser manufacturers anyway.

With regards to SugarCube….

I'm definitely not going to add a message telling people to enable third-party cookies. That would be as daft as what the browser manufacturers have done.

I could rearrange things a bit so that the localized no-Web-Storage message is displayed, rather than the current unlocalized error from the storage subsystem. Or I could add a new localized message just for that.

I suppose I could also work a mention of the third-party setting in somehow.

We'll see.

tmedwards commented 1 year ago

The new localized error message:

Your browser either lacks or has disabled all usable storage APIs. Possible causes are a disabled third-party cookie setting, which also affects Web Storage, or a private browsing mode.

BawdyInkSlinger commented 1 year ago

This is great! Thank you.