Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save options in localstorage #3

Closed
Skalman opened this issue Sep 28, 2014 · 10 comments
Closed

Save options in localstorage #3

Skalman opened this issue Sep 28, 2014 · 10 comments

Comments

@Skalman
Copy link
Owner

Skalman commented Sep 28, 2014

Changed options should be kept upon reload. The best way to solve that would probably be to save them in localstorage.

The "reset" button should reset the options to our defaults.

@tomByrer
Copy link
Contributor

Good idea!
Main.js here is where someone added local storage.
I've used https://github.com/mozilla/localForage to ensure browser compatibility that don't have localStorage. There is a new wrapper for it: https://github.com/alekseykulikov/storage

@Rikk
Copy link
Contributor

Rikk commented Sep 28, 2014

As user, I'm much happier with PHP Sessions and cookies, than with that new localstorage thing that always add new permanent trash to my browser profile 'storage' folder, and is not cleaned with 'clean cache/cookies' command.

@tomByrer
Copy link
Contributor

Though making localStorage optional & clear-able is a good idea, I'm sure many websites you visit already save on your HD.

@Skalman
Copy link
Owner Author

Skalman commented Sep 29, 2014

@Rikk, if you want to make sure that no trash is added to your browser profile, use private windows or set your browser to clear everything when closing. This tool would also only use localstorage if you actually change the options.

Cookies are a bad alternative, because they're sent to the website, even when not needed. And in this case they aren't.

@tomByrer, the localStorage API is simple to use, and all browsers in use except Opera Mini supports it (localForage doesn't support Opera Mini either).

@Rikk
Copy link
Contributor

Rikk commented Sep 29, 2014

Actually, in Firefox, sites using this storage thing will create this folder structure inside user profile and nothing can clean and delete them (unless manually):

storage
|-persistent
  |-http+++example.com
    |-idb
    |-.metadata
  |-[...]
|-temporary
  |-http+++example2.com
  |-[...]

I found many old (and ignored) bugs around this topic, eg.,
https://bugzilla.mozilla.org/show_bug.cgi?id=602743
https://bugzilla.mozilla.org/show_bug.cgi?id=527667

I hope the adoption of this kind of storage remains small until nasty bugs generating trash inside profile are fixed.

I talked about PHP Sessions cause setting some option can be easy as a few lines for the current browser session. Although I don't know if we can host php pages in this github gh-pages.

@Skalman
Copy link
Owner Author

Skalman commented Sep 30, 2014

@Rikk, using a private window, or clearing all history upon closing the browser, will solve this.
Github pages don't support PHP, and using a 1,2 kB cookie is not an option.

I also don't think that saving 1,2 kB of data on people's computers, where they actually change the options is a big deal.

This will be implemented. If you want a version without localstorage, you're free to fork the project.

@Rikk
Copy link
Contributor

Rikk commented Sep 30, 2014

No problem, I already forked it, and you used one of my commits without even referring me. Thanks for seem it as useful.
About Firefox problem, "clearing all history" does not clean this kind of storage in Firefox, when these folders are created.
However, in this case, your implementation did not trigger the creation of those trash folders. So... good job!

@Skalman
Copy link
Owner Author

Skalman commented Sep 30, 2014

@Rikk, I guess I should have mentioned you as giving the idea, but it felt like such a small commit that it didn't matter.

@Rikk
Copy link
Contributor

Rikk commented Sep 30, 2014

no problem, it really didn't matter.
btw, I think there's some git command that pull changes from one repo to other while keeping original names, but I'm still noob in scm and git.

@Skalman
Copy link
Owner Author

Skalman commented Oct 1, 2014

Yup, it's possible, and not that difficult, but for such small change I didn't think it was worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants