Dotgrid icon indicating copy to clipboard operation
Dotgrid copied to clipboard

Suggestion: Add Guidance on Usage via Browser, Suggestions, Pitfalls, etc.

Open shawntax opened this issue 4 years ago • 3 comments

Hello!

With the app now being delivered through a single html file (👏), folks who attempt to open the app locally (i.e through the file:///path URI) via a modern, Chromium-based browser will run into a hurdle:

Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

If the "Block third-party cookies" setting is enabled.

A quick fix is to disable the setting, unblocking third-party cookies for all sites. But I would imagine the privacy-minded folks, myself included, wouldn't be too happy with that. Chromium allows you to add specific URLs or hostnames to an "Allow" list, however adding the specific file URI to the allow list does not work here because localStorage is per domain , and the file:/// URI scheme has an empty hostname by default (an insight gathered from this StackOverflow answer).

A workaround is to add localhost/127.0.0.1 to the "Allow" list, and then visit http://localhost/.../index.html using a local webserver. (adding localhost to the "Allow" list and then specifying the hostname in the file URI, e.g file://localhost/Users/me/dotgrid-main/index.html, does not work for some reason 🤷)


Would you consider adding a little section in the docs that describe some basics on opening via a browser, suggestions, pitfalls, etc. ? I know your philosophy is Linux-first and I've seen you recommend browsers like surf and Next. But I think some guidance here would be helpful for those using Chromium-based browsers starting, with the third-party cookie issue described above.

Thanks for all the great work!

shawntax avatar Mar 24 '20 20:03 shawntax

I will install chromium and do some testing, I believe that the theme tools is the only thing that uses localstorage, I might be able to work around that. Stay tuned :)

neauoire avatar Mar 24 '20 22:03 neauoire

There is some fuse about SameSite option for cookies, maybe it's related

vintprox avatar May 14 '20 10:05 vintprox

@vintprox are you referring to this?

While you'll see the warning in your console, it's unrelated. Dotgrid is not setting any cookies, just accessing localStorage.

shawntax avatar May 23 '20 18:05 shawntax